Import CSV files into Zaps – Zapier

You can use [Formatter](https://help.zapier.com/hc/en-us/articles/8496212590093) to import CSV files and use the data in your Zap.

Zapier can import a CSV [file object](https://help.zapier.com/hc/en-us/articles/8496259603341#step-4) from an app or from a public URL that points to the CSV file.

![actionEdit icon](https://cdn.zapier.com/storage/photos/649a3c82786155ec1f844e1e870a74bf.png) Example

You receive a CSV file in an email and need to add the data to an existing Google Sheet spreadsheet. You can import the CSV file to send the data directly to the spreadsheet with a Zap.

## 1\. Add a Formatter Utilities step to your Zap

*   In the Zap editor, click the **Action** step, or click the **plus + icon** to add a step to your Zap.
*   Select **Format**.
*   Click the **Event** dropdown menu and select **Utilities**.
*   Click **Continue**.

## 2\. Set up your options

Next, set up the action:

*   Click the **Transform** dropdown menu and select **Import CSV File**.
*   Click the **CSV File** field and select a [file](https://help.zapier.com/hc/en-us/articles/8496288813453) from a previous step.
*   In the **Force First Row as Header Row** field:
    *   If you select the default **No**, the Zap will try to determine your header field values.
    *   After testing the step, if these header field values are incorrect, select **Yes**. The Zap will then get the header field values from row 1.
*   In the **Type of CSV file** field:
    *   If you select the default **Detect Automatically**, the Zap will try to detect the file type.
    *   If your file isn’t recognized when you test the step, you can select a different file type from the dropdown menu.
*   In the Encoding of CSV File field:
    *   If you use the default (UTF-8), the Zap will assume UTF-8 encoding (the most popular type of file encoding).
    *   If your file encoding isn't recognized, you can select a different encoding type from the dropdown menu.

## 3\. Test your CSV import step

*   Click **Test & Review**. If the import is successful, you will see two output fields:
    *   **csv\_text**: a text field that includes all of the text from the CSV file.
    *   **line-items**: line-item fields for each of the CSV file's column values.
*   If the _header_ field is _true_, a header was found in the file.

![Formatter CSV test output](https://cdn.zappy.app/4af466d46ae9c9e03a936a271abeede7.png)

![ratingStar icon](https://cdn.zapier.com/storage/photos/8843673cace5f7b922c65168a85d657e.png) Tip

If your _header_ field is _false_, click **Retest & Review**. Click the **Force First Row as Header Row** field and select **Yes**, then test the import action again.

After importing your CSV file with Formatter, you can [use the line items](https://help.zapier.com/hc/en-us/articles/8496277737997) in the rest of your Zap.

## 4\. Troubleshoot common problems

**I don't see my full CSV file when I run a test step**

The test step is limited to 1,000 characters of text and 50 line items. When the Zap runs, it will import the full CSV file.

**Error: CSV Import only supports file sizes < 150K**

The Import CSV File utility only supports importing files that are 150 KB or less in size (around 1,000 rows of a 10 column CSV file). You'll need to split the CSV file into multiple files if it's too large.

**Error: Could not determine delimiter**

The CSV file you're trying to import doesn't use a recognized delimiter (commas, semi-colons, tabs), or the delimiter wasn’t recognized. If you know your delimiter or you have a one column CSV, you can select it in the _Type of CSV File_ option. If your file still isn't recognized, you can select **Text file (No CSV Parsing)** to read the file contents as a text field, then use other Formatter steps to process the text.

**Error: utf8 codec can't decode byte xxx in position yyyy: invalid continuation byte**

The Import CSV File utility defaults to UTF-8 encoding. If you don't know your file encoding, you can try Latin-1 or UTF-16 from the Encoding of CSV option. Latin-1 is common for files that include diacritics, UTF-16 for files that include graphic characters. If you know your encoding and it's not one of these options, [other encodings](https://docs.python.org/3/library/codecs.html#standard-encodings) might be supported using the Custom option.

**My action app does not support line items**

You can use Formatter to [convert line items into text strings](https://help.zapier.com/hc/en-us/articles/8496308258189).