How to Generate CSV Files
Create a CSV file from Zapier, Integromat, or a simple POST Request from JSON data.
Quick Links:
- RECOMMENDED if using Zapier - Create a CSV File using the EasyCSV Action for Zapier
- Zapier - Generate a CSV File using the Zapier Webhook Action
- Zapier - Generate a multi-row CSV File from a Shopify Order with Line Items
- Zapier - Generate a multi-row CSV File from Zapier line-items (like from an Invoice) using the webhook action
- Generate a CSV File using a POST request with JSON
- Generate a CSV File using the Integromat Webhook Action
- How do I generate multiple blank column headers in my output file?
- Special syntax for dates, times, and uniqueness for your files & emails
- How do I generate an XLSX file instead of CSV file?
- How do I send the generated CSV files to different emails for my individual users?
- How do I encrypt the CSV file using PGP?
- How do I create a public temp file url or NOT? and how long do the temp files last?
Generate a CSV File using the EasyCSV Action for Zapier (Recommended for Zapier)
- In Zapier, create a new Zap.
- For the first trigger step choose any App where the data is coming from.
- For the action step, search for and choose "EasyCSV". You will choose the only option for EasyCSV which is "Create CSV File".
- 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:
Step-by-step
- Add a key in the left column: header_row
- 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.
- For every row after that you can specify the record/row data of the CSV file.
- For Row 1, type the key in the left column: row_data_1
- 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.
- At this point, you can continue with your Zap if you are making single-record CSV files.
- 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.
- Then to make another row add another left-column key: row_data_3
- You can add as many rows as you like by incrementing: row_data_X
- 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:
Step-by-step
- Add a key in the left column: raw_data_string
- In the field on the right of "raw_data_string", specify a string/text that is a valid array of JSON.
- 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
- After logging in to EasyCSV, click the "All CSV Generators" link after clicking to open the top nav behind your username.
- Create a CSV Generator
- After you create a CSV Generator you will get a webhook URL to send a POST request to.
- In Zapier, create a new Zap.
- For the first trigger step choose any App where the data is coming from.
- For the action step, choose "Webhooks by Zapier".
- For the field "Choose Action Event" choose "POST".
- Click the continue button.
- For the "URL" field paste the webhook for your CSV Generator from EasyCSV.io
- For "Payload Type" select "Json"
- 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.
- For "Wrap Request in Array" select "Yes".
- You do not need to do anything else and can click the Continue button.
- Test your Zap and then turn it on. You are all set!
- 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 a Shopify Order with line-items
How-to Video
Code to copy & paste
Generate a multi-row CSV File from Zapier line-items (like from an Invoice)
How-to Video
Step-by-step description
- 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.
- 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.
- After you create a CSV Generator you will get a webhook URL to send a POST request to.
- In Zapier, create a new Zap.
- 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.
- 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.
- For the "Action Event" dropdown choose "Utilities"
- For the "Transform" dropdown choose "Line-item to text"
- 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) - For the "Seperator" field type three pipes: |||
- Click the "Test & Continue" button.
- For the final action step, choose "Webhooks by Zapier".
- For the field "Choose Action Event" choose "POST".
- Click the continue button.
- For the "URL" field paste the webhook for your CSV Generator from EasyCSV.io
- For "Payload Type" select "Form" if it's not already selected
- 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.
- For "Wrap Request in Array" select "No" if it is not already selected.
- You do not need to do anything else and can click the Continue button.
- Test your Zap and then turn it on. You are all set!
- 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
- After logging in, click the "All CSV Generators" link after clicking to open the top nav behind your username.
- Create a CSV Generator
- After you create a CSV Generator you will get a webhook URL to send a POST request to.
- 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}]'
- - 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"}]'
- 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
- After logging in, click the "All CSV Generators" link after clicking to open the top nav behind your username.
- Create a CSV Generator
- After you create a CSV Generator you will get a webhook URL to send a POST request to.
- In Integromat, create a new Scenario.
- For the first step of your scenario choose any App where the data is coming from.
- For the last step, choose the "HTTP" module.
- For the HTTP module choose the type "Make a request".
- For the "URL" field paste the webhook for your CSV Generator from EasyCSV.io
- For "Method" select "POST"
- 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. - For "Body Type" select "Raw".
- For "Content Type" select "JSON".
- You do not need to do anything else and can click the Ok.
- Test your Integromat Scenario and then turn it on. You are all set!
- You can check the import log table at the bottom of your EasyCSV CSV Generator page for details on successful generations or errors.
How do I generate multiple blank column headers in my output file?
You can add BLANK01, BLANK02, BLANK03, etc... to any header row column name and it will become an empty value.
For example, sending:
name,email,BLANK01,BLANK02,phone
Becomes this in the output file:
name,email,"","",phone
You want to increment BLANK01, BLANK02, BLANK03, etc... instead of just the word BLANK because your data will match with those unique header values till they are removed right before the file is finalized.
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_2024.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_09_2024.csv leads_to_hubspot_9_2024.csv |
Previous day with Month and Year (yesterday): {YESTERDAY_YYYYMMDD} {YESTERDAY_YYYY-MM-DD} {YESTERDAY_MMDDYYYY} |
Filename: leads_to_hubspot_{YESTERDAY_YYYYMMDD}.csv Filename:leads_to_hubspot_{YESTERDAY_YYYY-MM-DD}.csv Filename:leads_to_hubspot_{YESTERDAY_MMDDYYYY}.csv |
→ | leads_to_hubspot_20241010.csv leads_to_hubspot_2024-10-10.csv leads_to_hubspot_10102024.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_20241011.csv leads_to_hubspot_20241011.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_1728714076.csv New CSV File - 1728714076 |
{FILENAME} | Email Subject Line: New CSV File - {FILENAME} | → | New CSV File - leads.csv |
{ORDER_NAME} | Output File Name: new_order_{ORDER_NAME} * only available if the order was fetched by an EasyCSV Scheduled Fetcher |
→ | new_order_1005.csv |
{ORDER_NUMBER} | Output File Name: new_order_{ORDER_NUMBER} * only available if the order was fetched by an EasyCSV Scheduled Fetcher |
→ | new_order_5.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 generate a XLSX instead of a CSV file?
Simply end your desired filename in .xlsx and EasyCSV will generate an XLSX file for you
At the moment XLSX file generation is available for sending a generated file via Email, to FTP/SFTP, and the file URL returned to your Zap or API response will also be an XLSX file for you to use.
If you need to produce an XLSX file and send it to Google Drive, Dropbox, OneDrive, or something else, please reach out to EasyCSV support via chat or email and let us know. We may be able to add that quick 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.
How do I encrypt using PGP?
PGP encryption is only available for uploading the file via SFTP at the moment. If you need it for other places please contact support@easycsv.io and we may be able to add it quick.
How to encrypt your CSV file with PGP:
- Create or update your CSV Generator and specify the details to upload the file to an SFTP server.
- Look for and check the checkbox option labeled: Enable PGP file encryption.
- Specify both the receiver (usually an email address of who the PGP public key was created by or for) and the PGP key (usually a public key).
- Save the CSV Generator details.
- Make a request to create a new CSV and you should see the file pushed to your SFTP server. The filename uploaded to the SFTP server and the temp_file_url returned to Zapier should end in '.csv.gpg'. If you need the file extension to end in '.pgp' or something else please contact support@easycsv.io and we can help.
NOTE: If you specify to upload to other destinations in addition to SFTP the CSV files generated will not be encrypted at this time. If you need it for other places please contact support@easycsv.io and we may be able to add it quick.
How do I create a public temp file url or NOT? and how long do the temp files last?
EasyCSV can create Temp Files with non-guessable, secure URLs in case you need it. Zapier & Integromat, in particular, need this for you to use the generated CSV file in another step of your Zap. Public Temp File & URL are enabled by default for CSV files generated from Zapier.
To disable Public Temp Files and URLs, navigate to and edit your CSV Generator on EasyCSV.io. On the edit form, un-check the option for creating a temp file if you do not need a public URL for your use case.
How long do the temp files last? They last for 24 hours by default. You can change that to 10-20 minutes by selecting the shorter option on the CSV generator Edit form.
What do the temp file URLs look like? The temp file URLs have a long, random set of characters to protect the URL from being guessable. Similar to Dropbox if you have ever gotten a share link from that service for a file.