How to Generate CSV Files

Create a CSV file from Zapier, Integromat, or a simple POST Request from JSON data.

Generate a CSV File using the EasyCSV Action for Zapier (Recommended for Zapier)

  1. In Zapier, create a new Zap.
  2. For the first trigger step choose any App where the data is coming from.
  3. For the action step, search for and choose "EasyCSV". You will choose the only option for EasyCSV which is "Create CSV File".
  4. Depending on your use case pick from one of the options below for the "Set up Action" step:

Option 1: Specify header row and then row data to create a CSV

This option is great if you are making a single record CSV file. Also great if each record data is already seperated earlier in the Zap.

Step-by-step explanation below. Your end result will look like this:

Zapier header row to cerate CSV file.
Step-by-step
  1. Add a key in the left column: header_row
  2. In the field on the right of "header_row", specify a comma-separated list of what you want the header column values to be for the CSV file.
  3. For every row after that you can specify the record/row data of the CSV file.
  4. For Row 1, type the key in the left column: row_data_1
  5. In the field on the right of "row_data_1", specify a comma-separated list of what you want the column values for the row to be.
  6. At this point, you can continue with your Zap if you are making single-record CSV files.
  7. If you need to add more records to the CSV file you can specify as many rows as you need by incrementing the left-column key to: row_data_2. Then place the values in the right field for that row.
  8. Then to make another row add another left-column key: row_data_3
  9. You can add as many rows as you like by incrementing: row_data_X
  10. If this way of making a multi-line CSV file does not work for you use case, then try Option 2 below and contact support@easycsv.io if you need any help.

Option 2: Specify the data as a JSON string to create a CSV

This option is great if you are making a multi-line CSV file or the data came into the Zap as JSON. Think of it as a JSON to CSV converter.

Step-by-step explanation below. Your end result will look like this:

Zapier JSON to CSV file.
Step-by-step
  1. Add a key in the left column: raw_data_string
  2. In the field on the right of "raw_data_string", specify a string/text that is a valid array of JSON.
  3. Most people get the JSON array from an earlier step in the Zap. Either the data is passed to the Zap from another app as an array of JSON -OR- you can add a code step before the EasyCSV step to massage data into a JSON array. If you need help writing a code step to massage data please email support@easycsv.io with details of what you Zap looks like and what you want your CSV file to look like in the end. We can help write the code step for you :)

Last step: Send the file somewhere

Option 1: The EasyCSV action in Zapier will produce a URL to the CSV file. You can use this file URL in another Zap step and have it uplaoded to a Cloud drive, emailed to yourself, or anything else another Zap action let's you do with a File URL.

Option 2 (recommended): Log into EasyCSV and you will have a CSV Generator object created. You can specify where you want CSV files to go automatically. You can have them emailed to someone or uploaded to a FTP/SFTP server, Google Drive, or Dropbox.

Generate a CSV File using the Zapier Webhook Action

  1. After logging in to EasyCSV, click the "All CSV Generators" link after clicking to open the top nav behind your username.
  2. Create a CSV Generator
  3. After you create a CSV Generator you will get a webhook URL to send a POST request to.
  4. In Zapier, create a new Zap.
  5. For the first trigger step choose any App where the data is coming from.
  6. For the action step, choose "Webhooks by Zapier".
  7. For the field "Choose Action Event" choose "POST".
  8. Click the continue button.
  9. For the "URL" field paste the webhook for your CSV Generator from EasyCSV.io Zapier create a CSV file.
  10. For "Payload Type" select "Json"
  11. Data will be your key/value pairs. The keys in the left-column will become your header row of the generated CSV file. The values will be the first row of data. For the values, you will want to select the values from your first trigger step of the Zap.
  12. For "Wrap Request in Array" select "Yes".
  13. You do not need to do anything else and can click the Continue button.
  14. Test your Zap and then turn it on. You are all set!
  15. You can check the import log table at the bottom of your EasyCSV CSV Generator page for details on successful generations or errors.

Generate a multi-row CSV File from Zapier line-items (like from an Invoice)

How-to Video

Step-by-step description

  1. After logging in to EasyCSV, click the "All CSV Generators" link after clicking to open the top-right nav on the page behind your username.
  2. Create a CSV Generator and specify if you want the CSV file emailed to someone or uploaded via FTP/SFTP. We recommend you email your file to YOURSELF when doing this initial setup and testing. Then change it to email the real recipient after you verify everything is working as expected.
  3. After you create a CSV Generator you will get a webhook URL to send a POST request to.
  4. In Zapier, create a new Zap.
  5. For the first trigger step choose any App where the data is coming from. For example, maybe it's receiving a new Invoice from Xero or Zoho Books.
  6. To massage your line-item data into CSV-like rows we will add an action step with the "Formatter" by Zapier helper. Click the small (+) to add an action step and search for "Formatter" by Zapier.
  7. For the "Action Event" dropdown choose "Utilities"
  8. For the "Transform" dropdown choose "Line-item to text"
  9. In the Input field we will double-slash (//) separate a list of key:value pairs that will be parsed by EasyCSV. Use the double-slash (//) as the column separator. For example, for each line-item we want to create two columns in a CSV file. One for description of the item and one for the total price. We would type something like this in the Input field: description:(select the description value in Zapier for the line-item)//total:(select the total value in Zapier for the line-item) (screenshot example below) Zapier line-items to array and CSV utility action
  10. For the "Seperator" field type three pipes: |||
  11. Click the "Test & Continue" button.
  12. For the final action step, choose "Webhooks by Zapier".
  13. For the field "Choose Action Event" choose "POST".
  14. Click the continue button.
  15. For the "URL" field paste the webhook for your CSV Generator from EasyCSV.io
  16. For "Payload Type" select "Form" if it's not already selected
  17. Data will be the utility step result. For the left-field type "data". For the right field click in the field and open the "Utilities" option in the fly-out. Click "Show all options". Click the option titled "Output" text. Zapier line-items to array and CSV utility post to EasyCSV
  18. For "Wrap Request in Array" select "No" if it is not already selected.
  19. You do not need to do anything else and can click the Continue button.
  20. Test your Zap and then turn it on. You are all set!
  21. You can check the import log table at the bottom of your EasyCSV CSV Generator page for details on successful generations or errors.

Generate a CSV File using a POST request from JSON

  1. After logging in, click the "All CSV Generators" link after clicking to open the top nav behind your username.
  2. Create a CSV Generator
  3. After you create a CSV Generator you will get a webhook URL to send a POST request to.
  4. Send your POST request to your webhook URL with the param "data" consisting of an array of JSON objects (key/value pairs). Each item in the array will become a row in the CSV file. The keys of the first object will become the CSV header row. Example CURL:
    curl --location --request POST 'http://www.easycsv.io/generate_csv/12345-f9ae-678-b518-a84a786374c5?data=[{%22name%22:%20%22buc%20doe%22,%22email%22:%22bucdoe@easycsv.io%22}]'
  5. - OR - You can send a JSON array in the body of a POST request. Example CURL:
    curl --location --request POST 'http://www.easycsv.io/generate_csv/12345-f9ae-678-b518-a84a786374c5' \ --header 'Content-Type: application/json' \ --data-raw '[{"name": "buc doe","email":"bucdoe@easycsv.io"}]'
  6. You can check the import log table at the bottom of your EasyCSV CSV Generator page for details on successful generations or errors.

Generate a CSV File using the Integromat Webhook Action

  1. After logging in, click the "All CSV Generators" link after clicking to open the top nav behind your username.
  2. Create a CSV Generator
  3. After you create a CSV Generator you will get a webhook URL to send a POST request to.
  4. In Integromat, create a new Scenario.
  5. For the first step of your scenario choose any App where the data is coming from.
  6. For the last step, choose the "HTTP" module.
  7. For the HTTP module choose the type "Make a request".
  8. For the "URL" field paste the webhook for your CSV Generator from EasyCSV.io Integromat generate a CSV file.
  9. For "Method" select "POST"
  10. For "Query String" we will add the key "data". Then type an array of JSON. Example in screenshot and also below:
    [{"name": name_value_from_first_step, "email": email_value_from_first_step}]
    The keys of the first record will become the CSV header row and the values will be the first row of data after the header row.
  11. For "Body Type" select "Raw".
  12. For "Content Type" select "JSON".
  13. You do not need to do anything else and can click the Ok.
  14. Test your Integromat Scenario and then turn it on. You are all set!
  15. You can check the import log table at the bottom of your EasyCSV CSV Generator page for details on successful generations or errors.

Special syntax for dates, times, and uniqueness for your files & emails

You will most likely want to include some form of a date, time, or uniqueness in your CSV Generator. Whether it's for the output filename or for the email subject line or body copy. Use the special syntax below in your CSV Generator to have these values set when a file is generated.

Syntax Example(s)
{MMDDYYYY}
{YYYYMMDD}
Filename: leads_to_hubspot_{MMDDYYYY}.csv
Email Subject Line: New CSV File for {MMDDYYYY}

leads_to_hubspot_01232021.csv
New CSV File for 01232021
{MMDDYY}
{YYMMDD}
Filename: leads_to_hubspot_{MMDDYY}.csv
Email Subject Line: New CSV File for {MMDDYY}

leads_to_hubspot_012321.csv
New CSV File for 012321
{DDMMYYYY} Filename: leads_to_hubspot_{DDMMYYYY}.csv
Email Subject Line: New CSV File for {DDMMYYYY}

leads_to_hubspot_23012021.csv
New CSV File for 23012021
{DDMMYYYY} Filename: leads_to_hubspot_{DDMMYY}.csv
Email Subject Line: New CSV File for {DDMMYY}

leads_to_hubspot_230121.csv
New CSV File for 230121
{24HHMMSS} Filename: leads_to_hubspot_{MMDDYY}_{24HHMMSS}.csv
Email Subject Line: New CSV File for {MMDDYY} - {24HHMMSS}

leads_to_hubspot_012321_182330.csv
New CSV File for 012321 - 182330
{YYYY}
{MM}
{DD}
{24HH} - Hour (24)
{MIN} - Minute of hour
{SS} - Seconds
Filename: leads_to_hubspot_{YYYY}.csv
Filename: leads_to_hubspot_{MM}-{DD}.csv
Filename: leads_to_hubspot_{24HH}-{MIN}-{SS}.csv

leads_to_hubspot_2021.csv
leads_to_hubspot_01-21.csv
leads_to_hubspot_22-32-55.csv
Previous month
(last month):
{PREVIOUS_MM}
{PREVIOUS_M}
Filename: leads_to_hubspot_{PREVIOUS_MM}_{YYYY}.csv
Filename: leads_to_hubspot_{PREVIOUS_M}_{YYYY}.csv

leads_to_hubspot_06_2021.csv
leads_to_hubspot_6_2021.csv
Previous day
(yesterday):
{PREVIOUS_DD}
{PREVIOUS_D}
Filename: leads_to_hubspot_{YYYY}{MM}{PREVIOUS_DD}.csv
Filename: leads_to_hubspot_{YYYY}{MM}{PREVIOUS_DD}.csv

leads_to_hubspot_20210724.csv
leads_to_hubspot_20210724.csv
{UNIQUE_ID} Filename: leads_to_hubspot_{UNIQUE_ID}.csv
Email Subject Line: New CSV File - {UNIQUE_ID}

leads_to_hubspot_a1b2c4d5.csv
New CSV File - a1b2c4d5
{EPOCH} Filename: leads_to_hubspot_{EPOCH}.csv
Email Subject Line: New CSV File - {EPOCH}

leads_to_hubspot_1627215886.csv
New CSV File - 1627215886
{FILENAME} Email Subject Line: New CSV File - {FILENAME} New CSV File - leads.csv
Need something else? Email support@easycsv.io and ask for what you want and give us an example of how you will use it. We will probably add it quickly for you.

How do I send the generated CSV files to different emails for my individual users?

In addition to passing the "data" param in the post request, you can pass a param key of "recipient_email" and the value of that param being the email of the person you want to receive the generated CSV file.