Skip to main content

Import custom data

Manually import data to your custom data table with a CSV file upload, or use an import channel or the API.

Updated today

Manual import

To import data using a file upload:

  1. Go to Data > Custom data.

  2. Select the data table you want to add data to.

  3. Select the Import data tab.

  4. Select MANUAL IMPORT to open the Upload Data menu.

  5. Select browse and choose the file you want to upload, or drag and drop the file.

  6. Under Upload options, if you want to replace all data in the table with the data from the file, select the Replace all data checkbox.

    To instead append the new data to the existing data, leave the checkbox clear.

  7. Select IMPORT.


Import channel

To set up an automated FTP import channel for a custom data table:

  1. Go to Data > Custom data.

  2. Select the data table you want to add data to.

  3. Select the Import data tab.

  4. Select IMPORT CHANNELS FOR DATA TABLES.

  5. Under Set up a new channel, expand the drop-down menu and choose the data table you want to import to.

  6. Select CREATE IMPORT CHANNEL.

  7. On the next page, specify the settings for the import channel.

    Refer to the section Custom data table import settings below for more information. For FTP import channel settings, consult your IT team if you’re unsure.

  1. Select SAVE.

Custom data table import settings

Setting

Description

Channel name

An easy-to-remember name for your channel.

FTP type

The type of FTP.

For large files (10 MB or more), we recommend using FTPes.

FTP host

The address of your FTP server.

FTP port

The FTP port used:

  • FTPes server
    Leave this field empty. The default port for FTPes is to leave it blank.

  • SFTP
    This should usually be set to 22.

If you're not sure what port you need to use, leave this field empty or to its default value, or contact your ESP or FTP support provider.

FTP username

The username for connecting to your FTP server.

FTP password

The password for connecting to your FTP server.

FTP interval

The number of minutes between runs.

We suggest 60, which means the FTP server is accessed every 60 minutes.

FTP directory

Where files on your FTP server are read from.

FTP allowed files pattern

The file pattern allowed on the FTP server, for example, d*.csv.

A comma separated list is accepted, for example, d*.csv,t*.csv. You must specify a pattern, such as person*.csv, transaction*.csv, product_import*.csv.

CSV and TSV formats are supported. Import filenames specified on segments which import from this channel are also read from the FTP server.

FTP field mapping

The JSON object that describes how fields from the CSV are mapped into the custom data table. All field names are case sensitive. The outer key contains the logical field names (the field names that go into the system).

Each field is an object which contains an ftp_field_name property, which contains the name of the field in the CSV. For example, to map TeamName from the CSV, to team_name for the system: {"team_name":{"ftp_field_name":"TeamName"}}.

You must include all the fields you want to import in the field mapping, even if both values are the same.

You can also specify a date_format to go with a date field as follows: {"date":{"ftp_field_name":"date", "date_format":"%Y-%m-%d"}}. If you don’t specify a date format, we try to automatically recognize it for the import.

Import type

The type of import method:

  • Append
    Update existing data and append new data.

  • Replace
    Delete all existing data and replace with new data.

Is service paused?

Optionally, select this checkbox to stop the import task from running.


API import

You can also use the Fresh Relevance API to import data to a custom data table.

CSV file field mappings

You can’t create field mappings using this method. Only the data in the CSV file is uploaded.

To do this:

  1. To create an API access token, expand the User menu, and go to Settings > Other Integrations > Fresh Relevance Access Tokens.

  2. Either:

    1. Create a new token and copy the token’s name and key for later.
      Learn more in Create and edit API access tokens.

    2. Copy an existing token’s name and key for later.

  3. Make a POST request to /api/<website_id>/custom_data_tables/import/<table_id>/

  4. You can include the token as either:

    • A header. For example, HTTP_X_API_KEY.

    • A query parameter. For example, api_token.

  5. Add the CSV file you want to import to the form-data of the request under the key files[].

  6. Provide the key importType, which is either append or replace, depending on which option you want.


View import jobs

To view all current and scheduled custom data table import jobs, either:

  1. Go to Data > Custom data.

  2. Select the data table you want to add data to.

  3. Select the Import data tab.

  4. Select IMPORT JOBS.

or:

  1. Expand the User menu.

  2. Go to Settings > Imports > Custom data tables import jobs.


Next steps: Use custom data

Did this answer your question?