Skip to main content
Embed the CSVbox importer in your app with a short code snippet. Go to the Code tab of the sheet, find the integration code, and place it in your application where you want the import button to appear.

Install the importer

Sample code with basic usage:
Each sheet has a unique license key. Find it on the Code tab of the sheet page and pass it to the CSVBoxImporter function.
If your app or database restricts access to an IP allowlist, you need to manually add CSVbox’s addresses to use the importer. Allowlist all of the following IP addresses:
  • 18.233.84.183
  • 18.213.249.53
  • 3.73.26.144
Only one of these addresses is in use at any time, but the active address can change at any time. Add them all to your allowlist to avoid interruptions in service.

Referencing the user

Configure custom user attributes in the installation code to identify the users on your platform and match them with their imports.
Pass custom user attributes as input parameters to the setUser method. The custom user attributes are pushed to your destination along with the uploaded data.user_id is the only mandatory custom attribute. Apart from user_id, you can add up to 4 custom attributes in the <key>: <value> format. Example:

Callback function

Once the user uploads a file, the importer returns the status of the import along with metadata describing the completed import. Data is returned in two variables, result and data:
  • result: a boolean that is true if the import succeeds and false if it fails.
  • data: JSON data as shown below.
The data object is null if the import fails. You can also configure the importer to receive the entire file data in JSON format in the data object. Learn more.
You can write custom code to handle the success or failure conditions on the client side.
The result and data variables are available in the callback function, which is triggered when the import completes.

Options

These additional configuration options are available with the CSVbox importer.
The following examples set several of these options:
Pass additional options as input parameters to the setOptions method.

Events

These additional importer events and properties are available.
The following examples listen to these events:

Other settings

Lazy load

The importer assets load when the webpage loads. This can slow your app if you initialize multiple importers on the same page. As a workaround, defer loading the importer assets until the Import button is clicked by adding the lazy: true parameter to the initialization code.

Next steps

3. Receive Data

Receive the imported data in your app.

Destinations

Choose where CSVbox sends the imported data.