Merge Data from a CSV (spreadsheet)

Have a spreadsheet (CSV) full of data that you want to merge into your documents?  You can easily upload your CSV to either a document or a data route and we'll generate a document for each row in the spreadsheet.

After you've built (and tested) your document/data route, go to the Merge tab and then click on the Upload Data button.  On this page, you'll be able to upload your CSV file (or provide a link to a file on the web).  Make sure that that first row in your spreadsheet has the names of the fields/columns.

csv_upload.png

 

After you've uploaded your spreadsheet, you'll be taken to a page where you can match up your merge fields with the columns in your spreadsheet.  You'll need to match up all of your merge fields so we know where to put the data in your template.

csv_fields.png

 

Once you have matched up all of your merge fields with the columns in your CSV, you're ready to merge the documents!  Click the Merge the Data button at the bottom of the page and we'll populate a document for each row in your CSV.

You'll be able to see the status of your merge by going back to the Merge tab and clicking on Upload Data.

 

Combine documents into single doc

If you need a way to combine all the documents generated from your CSV into a single document, click on the Advanced Options button then select the "Combine Documents" option.

 

Use all rows in a single merge

If you need a way to send all rows in the CSV to a single document, rather than individual documents, you will need to setup a loop in your document using the $_rows merge field like this:

Name Price Quantity
{tablerow from=$_rows item=_row}{$_row.name} {$_row.price} {$_row.quantity}{/tablerow}

The part after the "dot" in {$_row.name} is the name of the column (all lowercase) in our CSV.

Lastly, when you go to merge your document and upload your CSV, click Advanced Options then check the option to use all rows in a single merge.

 

Group rows by a field value

If you need a way to group the data by a certain field in your CSV (customer, order ID, etc) so that certain rows are sent to different documents, you'll first need to setup a loop in your document like in the section above.

Then when you go to merge the document and upload your CSV, check the option to "group" rows by a field under Advanced Options.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk