Hi, Humans. How may we help you?

Creating CSV files for import
10 min
Created by Leonora Alves on 2/19/2024 11:52 AM
Updated by Leonora Alves on 3/8/2024 4:21 PM

A CSV file (Comma-Separated-Values) is a type of file that you can create or edit in Excel, Google Sheets, OpenOffice Calc, among others. It is used by Zenvia Customer Cloud to configure personalized messages and load your contact database.

Instead of storing information in columns, CSV files store data separated by commas.

In this article, learn about the file requirements and how to:

File requirements

The file specifications are:

  • It must be in .csv format;
  • Up to 120 MB;
  • Saved with UTF-8 encoding. This type of file encoding allows reading the content when it contains special characters.

Create CSV using Microsoft Excel

  1. Open Microsoft Excel and press the CTRL + A key combination to select everything (cells will be highlighted in light gray). Make sure to select the Text option in the Number Format field. This ensures that all content entering the cells is plain text and does not cause conversion or compatibility issues when imported into the Zenvia platform.
  2. Create columns (one for each variable) and fill each cell with its corresponding value. Remember:
    • The first line of the file must be the header. In each column, enter the name of the variable you want to use in the message.
    • Phone numbers or email addresses should be in the first column, i.e., always in column A of the spreadsheet.
    • Separate each contact number per line in the file, in the format DDI+number or email@domain.com, without dashes, spaces, or dots (e.g., 14087654321).
    • Example of how to configure the file:
      • For the message "Hello {{name}}! Your appointment is scheduled for {{date}} at {{time}}. To cancel the appointment, call 0800 400 1100," the file must contain the message variables organized in separate columns. It should include columns for Name, Date, and Time, as the message text includes the variables {{name}}, {{date}}, and {{time}}, in addition to the mandatory Phone or Email column.
  3. After filling in the data, click File > Save As.
  4. Select the location where the file will be saved. Give the file a name and select the CSV UTF-8 (comma-delimited) (*.csv) file type.
  5. Click Save.

If you are using Microsoft Excel on Windows but cannot save as CSV UTF-8, select the CSV (comma-separated values) (*.csv) type and then use Notepad.

Use Notepad to Save the CSV file in UTF-8

  1. Open the file in Notepad.
  2. Click File > Save As.
  3. Give a name to the file and add the .csv extension at the end.
  4. In the Save as type menu, select All Files.
  5. In the Encoding drop-down menu, choose UTF-8.
  6. Finish by clicking Save.

Create CSV using Google Sheets

  1. Create a spreadsheet with Google Sheets, a free tool available through your Google account. Open the Sheets homepage at sheets.google.com, click New +. The spreadsheet will be created and opened. You can also create spreadsheets at the URL sheets.google.com/create.
  2. If you already have a database in Excel or another platform, import your file in XLS format into a Google Sheets spreadsheet. Follow these steps:
    1. Click File > Import;
    2. Choose the Excel file and click Select;
    3. Choose an import option: Create a new spreadsheet, Insert new sheets, or Replace spreadsheet;
    4. Click Import data. If necessary, click Open now.
  3. Create columns (one for each variable) and fill each cell with its corresponding value. Remember:
    • The first line of the file must be the header. In each column, enter the name of the variable you want to use in the message.
    • Phone numbers or email addresses should be in the first column, i.e., always in column A of the spreadsheet.
    • Separate each contact number per line in the file, in the format DDI+number or email@domain.com, without dashes, spaces, or dots (e.g., 14087654321).
    • Example of how to configure the file:
      • For the message "Hello {{name}}! Your appointment is scheduled for {{date}} at {{time}}. To cancel the appointment, call 0800 400 1100," the file must contain the message variables organized in separate columns. It should include columns for Name, Date, and Time, as the message text includes the variables {{name}}, {{date}}, and {{time}}, in addition to the mandatory Phone or Email column.
  4. Click File > Download and select the Comma-separated values (.csv) format. The encoding is UTF-8 by default.

💡 Tip: Make sure to name the file so that you can easily find it on your computer.

Editing a CSV file

You can make edits or additions to the data you want to send to Zenvia Customer Cloud. To do this in a spreadsheet, add columns with the values you want to assign. Now, to add or edit information in a CSV file, consider that:

  • Each data group should be organized in a line.
  • Each piece of data should be separated by a comma; however, the last record in a line should not contain a comma.

To edit your CSV file, use a text editor of your choice. Most computers have text editors compatible with .csv files, such as Notepad, WordPad, or Excel.

To do this, right-click on the file, select Open with, and choose the text editor.

Here's an example of how the information is presented when opening a CSV file:

Phone,Name,Date,Time
14081234567,John,05/03/2020,13:30
14087654321,Sonia,09/05/2019,15:45
14085671234,Anna,11/02/2011,17:50

Note that:

  • The first line corresponds to the header, and each value is separated by a comma, without spaces, namely Phone, Name, Date, and Time;
  • Each line contains data related to that contact in the order of the header. That is, data for John is on one line, while data for Sonia is on another, in the same sequence (Phone > Name > Date > Time);
  • We do not add a comma at the end of the data because it is the last record in the line.

Now that you know how to create and configure the file containing your contact information, upload it in the message dispatch settings.

Importation issues and how to resolve them

During file importation, here's what to do if you encounter any of the results below:

Error How to solve
Invalid format Ensure the file is in CSV format and UTF-8 encoding.
File too large Split the file into smaller parts or consider reducing the original file size to meet the 120 MB limit.
File must have more than 01 (one) line Confirm that the file contains more than one line of data. Add at least one valid contact information line to proceed with the import.
File without header Check if the file contains the header with phone numbers or email addresses and the variables used in the message.
Duplicate contact data Review the file to identify and remove duplicated contact information.
Invalid phone or email format Verify that phone and email formats are correct for each contact in the file. The phone format DDI+number or email@domain.com, without dashes, spaces, or dots (e.g., 14087654321).
Many phone or email formats Standardize formats to ensure consistency in the file.