Locoia
  • Overview
  • Account and User Settings
    • User types
    • Adding Users
    • Teams
    • Access Permissions
    • 2 Factor Authentication 2FA
    • Versioning and Snapshots
    • Activity Log
  • Reset your Password
  • Invoices and Payments
  • Automation
    • Flow Builder
      • Flow Building Best Practices
      • Jinja Template Language
        • Jinja: (Custom) variables, wildcards and functions
        • Magic Code Samples
      • Connectors & APIs
        • Titles and References
        • Referencing data of objects, lists, arrays - how to pass data dynamically
        • Accessing Objects with JSONPath
        • Merging nested JSON objects
        • Parsing JSONs from String
        • Response Headers & Status Codes
        • Custom Data Fields
        • Wildcard API calls and actions
        • Response cleaning
      • Text Strings, Date & Time, Numbers and Currencies
        • Text and Strings
        • Dates & Time
        • Numbers (Thousand Separators, Currencies)
      • Email-formatting
      • Code Fields
      • Running single Flow steps
      • Flow run data retention, logging, and error notifications
      • Advanced View
      • Dynamic Title
      • Custom Error Handling
      • Error Handling Flows
      • Automatic Pagination
    • Flow Debugger
      • Automatic Retrying
      • Run Flows again
      • Troubleshooting Flows
    • Community Library
  • Connectors & Helpers
    • Connectors
      • Monday.com
      • ActiveCampaign
      • Aircall
      • Allthings
      • Amplitude
      • Animus
      • Assetti
      • Awork
      • AWS RDS Database - How to connect
      • bubble.io
      • Casavi
      • Chargebee
      • CleverReach
      • comgy
      • commercetools
      • Everreal
      • Exact Online
      • Facebook Marketing
      • Fahrländer Partner
      • FastBill
      • FILESTAGE.io
      • Freshdesk
      • Freshsales
      • Google Ads
      • Google Ads Lead Form
      • Google Analytics
      • Google Chat
      • Google Drive
      • Google Sheets
      • Gmail
      • HubSpot
      • Heyflow
      • iDWELL
      • ImmobilienScout24
      • Instagram Ads
      • Intercom
      • klaviyo
      • Kiwi Opening Doors
      • Klenty
      • Klipfolio
      • Kolibri CRM
      • konfipay
      • KUGU
      • Shopify
      • S3 AWS
      • SQS AWS
      • Lambda AWS
      • Learnster
      • lexoffice
      • LineMetrics
      • Linkedin
      • Locoia
      • Notion
      • MailGun
      • Makula
      • Microsoft Dynamics 365
      • Microsoft OneDrive
      • MixPanel
      • MongoDB
      • Odoo
      • OnFleet
      • OnOffice
      • Oracle NetSuite
      • Outbrain
      • Quickbooks
      • Trello
      • PandaDoc
      • Personio
      • Pinterest Ads
      • Pipedrive
      • Plentific
      • PriceHubble
      • relay
      • REALCUBE
      • Sage ERP
      • Salesforce
      • SAP
      • Scoro
      • Seafile
      • sevDesk
      • SharePoint
      • SharpSpring
      • Slack
      • Snapchat Marketing
      • Snowflake
      • Teamleader Focus
      • Teamwork.com
      • Tableau
      • TikTok
      • TinQwise
      • The Trade Desk
      • Twitter
      • Typeform
      • WordPress
      • Xero
      • Youtube
      • Zendesk
      • Zoho CRM
      • Zoom
    • Helpers
      • Scheduler
      • Webhook
      • Dict Helper
      • Spreadsheet Helper
      • REST Helper
      • Boolean Helper
      • Multi Case Helper
      • Looper
      • FTP Helper
      • CSV Helper
      • XLSX Helper
      • Mail Sender
      • Flow Trigger
      • File Storage Helper
      • Terminate Helper
      • Delay Helper
      • SQL Connector
      • PDF Helper
      • Zip Helper
      • Data Warehouse Helper
      • XML Helper
      • Form Helper
      • Arrow
      • Error Arrow
    • Authentication Types Available
      • Setting up authentication
      • OAuth1
      • OAuth2
      • Refreshable token
      • AWS Signature
      • Basic Auth and Other Simple Authentication Methods
      • How are API versioning and API updates handeled?
      • Custom OAuth2 clients (apps)
    • Building Connectors
      • Base Connector Setup
        • Connector Auth Validation
        • GraphQL APIs
        • Rendering with User Input
      • Building Connector Actions
        • Actions Examples
      • Search Automation
      • Pagination Automation
      • Uploading Files in Actions
      • Working with SOAP APIs
    • Super Actions
    • Webhook Trigger for Connectors
    • Data Mapping and Env Variables
  • Embed - White Label Portal
    • Embed Overview
      • 1. Embed Flow
        • 1.1 Creating Embed Flows
        • 1.2 Updating Embed Flows
        • 1.3 Embed Error Handling
        • 1.4 Setting up Callbacks for Integration activation/deactivation
        • 1.5 Setting up Remote search
        • 1.6 Setting up End User logs
      • 2. Configure Embed
        • 2.1 Embed Integration via SSO
        • 2.2 Proprietary connector setup
        • 2.3 Sharing level
        • 2.4 Consent screen
        • 2.5 Account Secrets
        • 2.7 Further settings
      • 3. Integrate Embed
        • 3.1 iframe vs native embed
        • 3.2 Customizing CSS
        • 3.3 Events emitted from iframe to parent window
      • 4. Embed for End User
        • 4.1 Embed Remote Search
        • 4.2 Embed End User Logs
      • 5. Test Embed Configuration
        • Testing example
      • 6. Embed Integrations and Connector Auths
    • Embed FAQs
  • Data and Dashboards
    • Dashboards & Insights
      • Introduction to Dashboards
      • Introduction to Insights
      • Introduction to Data Sources
      • Dashboard Filters
      • Insight Marketplace - Using Pre-Built Insights
      • Writing SQL Queries
      • Useful SQL Examples
      • Charts
        • Line Chart
        • Bar and Horizontal Bar Chart
        • Stat Card
        • Pie Chart
        • Gauge Chart
        • Donut Chart
        • Stacked Bar, Horizontal Stacked Bar, and Normalized Horizontal Stacked Bar
        • Multiple Line Chart
        • Pivot Table
        • Map Chart
  • Best Practice Guides
    • Integration Best Practices
    • Integration Check List
    • CSV Files in Excel
    • Multi-Tenant Flows
    • On-Premise Integrations
    • Database Connection Setup
    • Data and General Security
    • Using Tags
    • FAQ
  • API
    • Locoia API Authentication - Personal Access Token
    • Create Connector Authentication
  • Contact us
  • Status of Service
  • Data Privacy
  • Imprint
Powered by GitBook
On this page
  • Overview
  • Actions
  • 1. Reading CSV file from URL location
  • 2. Create CSV file
  • 3. Generate CSV from CSV text string
  • Additional settings
  • Encoding
  • Filtering a CSV file
  • Modifying a whole column in a CSV or dictionary

Was this helpful?

  1. Connectors & Helpers
  2. Helpers

CSV Helper

Read, manipulate and write CSV files from urls or ingested via email

PreviousFTP HelperNextXLSX Helper

Last updated 7 months ago

Was this helpful?

Overview

With the CSV Helper, one can read, manipulate and write CSV files from URLs or other sources.

Actions

1. Reading CSV file from URL location

This action reads a CSV string from a remote FTP location or HTTP URL location, including authorization tokens in headers.

Read produces a list (one entry for each row) of lists (one entry for each column), so the result of read_csv might look like this:

[
    ["Toyota", "2022", "Silver", "Camry"],
    ["Honda", "2021", "Blue", "Accord"],
    ["Ford", "2023", "Red", "Explorer"],
    ["Chevrolet", "2020", "Black", "Impala"]
]

2. Create CSV file

This action creates a CSV string from previously generated data and saves it as a .csv file. The user input contains a data reference—a ref ID pointing to a list of values—and a list of column field names. These column field names are used when iterating through the data given by the ref ID to extract values from the list element. If the columns are empty, then the CSV will contain just one column, namely, the corresponding line's string representation.

The input needs to be either a list of dictionaries [{...}, {....}] or list of lists [[...], [...]]

This action produces a CSV string and uploads it to the designated S3 bucket for storage. It can also be written to a file on an FTP server or sent as a mail attachment.

Note: If you provide a list of dictionaries where some dictionaries contain empty keys (""), the resulting CSV may contain null values for those fields, as there are no valid column headers to map the data. To avoid this, ensure all dictionaries have valid, non-empty keys when generating the CSV file.

Example:

  1. List of Lists:

[
    ["Name", "Age", ""],  
    ["Alice", 30, "New York"],
    ["Bob", 25, "Los Angeles"],
    ["Charlie", 35, "Chicago"]
]

# Resulting CSV might look like:

0,1,2
Name,Age,
Alice,30,New York
Bob,25,Los Angeles
Charlie,35,Chicago

Here, the last column has an empty header, so it is assigned a null value in the resulting CSV.

  1. List of Dictionaries:

[
    {"Name": "Alice", "Age": 30, "": "New York"},
    {"Name": "Bob", "Age": 25, "": "Los Angeles"},
    {"Name": "Charlie", "Age": 35, "": "Chicago"}
]

# Resulting CSV might look like:

Name,Age,
Alice,30,
Bob,25,
Charlie,35,

In this case, the dictionaries have an empty key (""), leading to empty values in the CSV output for that column.

Configuration outcome matrix:

Print_headers

selected_columns

new_column_names

outcome

yes

Some valid columns

Some valid names

If selected and new names have different length -> error Use new column names

yes

Some valid columns

nothing

Use selected column names

yes

nothing

Some valid names

Expect new_colum_names to have ONE entry

yes

nothing

nothing

Error

no

Some valid columns

Some valid names

Info(Unused new names)

no

Some valid columns

nothing

Regular csv without headers

no

nothing

Some valid names

Info(Unused new names)

no

nothing

nothing

CSV with one column and no headers

3. Generate CSV from CSV text string

This action takes a string and converts it to CSV. For instance, you want to transform "John,john@example.com,555-1234" to CSV.

Additional settings

Encoding

For all CSV actions, an encoding can be selected which should be used to write/read the CSV file. This can be left at utf_8 for almost all cases. This is only needed if the CSV file was saved or is expected to be saved in a specific encoding.

This is especially relevant for umlaute and special characters.

Filtering a CSV file

To add a filter:

  • Connect to a Dict Helper step

  • Select the Filter List V2 action.

  • Fill the List reference input with a CSV reference without the {{ }}

  • Set up your filter criteria

Modifying a whole column in a CSV or dictionary

Oftentimes, formats of e.g. dates are different in every system and need to be adjusted and modified to reflect the format of a different system.

Imagine a CSV with the column header datetime and the below three datetimestamps. That needs to be changed to only dates, like 2019-06-18

; datetime
; 2019-06-18 23:23:23.232736734
; 2019-04-12 23:23:23.232736798
; 2017-06-11 23:23:23.232736727

To do the above, you need to use a combination of:

  1. The connector or helper passing the object

  2. A looper that changes something in every object

  3. and a dict_helper that changes a particular field in a dict

  4. and a date helper that formats data in a particular way

Authentication on the CSV-Helper was deprecated in 2021. Please use a instead to fetch a file and then read it via CSV Helper.

If you only have one dictionary that you would like to insert, wrap it inside a list with the , e.g. [ {{ my_dictionary }} ]

If an encoding does not support characters used in the CSV (e.g. ), the step will result in an error.

The .

To filter a CSV file, use from the Dict Helper

REST Helper
languages with incomplete coverage in latin-1
full list of supported encodings can be seen here
Dict Helper
Filter List V2
Excerpt of encoding options