Integromat
  • Back to website
Articles in this section
  • Airtable
  • Bubble
  • Email
  • Facebook Groups
  • Formstack
  • Google Cloud Vision
  • Google Sheets
  • HTTP
  • HubSpot CRM
  • JSON
See more
  1. Integromat Support
  2. Apps
  3. Docs

CSV

Integromat Integromat Updated February 06, 2019 13:00

Getting started with CSV

The Parse CSV transformer lets you parse a csv text from a received text value or a file. If your data comes in binary form (typically from a file), you have to use the toString() function to convert the binary data to String:

The Create CSV aggregator lets you create a csv text from received text values.

The Create CSV (advanced) aggregator lets you create a csv text from received text values. It employs a Data structure that defines the CSV columns in the resulting CSV file. Once defined, the columns appear as fields in the CSV module setup, available for mapping.

Transforming complex data to CSV

Let us assume you would like to export your Google contacts to a CSV file with two columns "Full Name" and "Email". The output bundle from the Google Contacts > Get contacts from a group module has the following structure (see on the right). The email addresses are stored inside the Emails[] item, which is an array of collections, each collection containing two items: Label and Email.

If you employ the simple Create CSV module, you are offered a list of checkboxes corresponding to a bundle's top-level items. If you attempt to tick Full name and Emails items, the Create CSV module will produce the following output, which is probably not what you wished for:

"emails","fullName"
"[object Object]","Shon Winer"
"[object Object]","Lizeth Fulmore"
"[object Object]","Hilario Gullatt"
"[object Object]","Abby Eisenbarth"

Since the item Full Name is of simple type Text, it is exported just fine. But the item Emails, which is of a complex type Array of Collections, is exported as [object Object], which is how Collections and Arrays are transformed to text by default.

To export content of the Email item of the first collection of the Emails[] array instead, it is necessary to employ the Create CSV (advanced) module. The module will enable you to define individual columns of your CSV file and map items to them, including the nested ones.

  • [1] Insert the module Create CSV (advanced) in a scenario and open its configuration.
  • [2] Click the "Add" button next to the Data structure field to create a new Data structure.
  • [3] Write in a name for the Data structure and click the "Add item" button to add the individual columns. If you wish to export two columns: "Full Name" and "Email", the resulting Data structure would look like this:

  • [4] Once you have successfully defined the Data structure, fields corresponding to each individual column should appear in the configuration of the Create CSV (advanced) module so you can map the items. Take the first item from the Emails[] array and map its item Email to the field/column Email:

  • [5] Execute the scenario. Since the item Emails[1]: Email mapped to column "Email" is of simple type Text, it will be exported correctly now:
"Full Name","Email"
"Shon Winer","Shon@Winer.com"
"Lizeth Fulmore","Lizeth@Fulmore.com"
"Hilario Gullatt","Hilario@Gullatt.com"
"Abby Eisenbarth","Abby@Eisenbarth.com"
Was this article helpful?
2 out of 6 found this helpful
Menu
  • Features
  • Apps & Services
  • Templates
  • Pricing
  • What's new
  • Use cases
Information
  • Terms,  Privacy
  • FAQ
  • Help & Tutorials
  • Community
  • Affiliate Program
  • Blog
Developers
  • Developer Platform
Company
  • About the company
  • We are hiring
  • Contact
Follow us
© 2018 Integromat. All rights reserved. Integromat® is a registered trademark.
  • English