Importing Custom Columns

Custom columns are supported in the importer and validation webhooks.

Custom Columns

A custom column is denoted in the columns array with the field is_custom: true. The values of a custom column are included as a JSON object in a key called $custom. The keys of the object are indexes into the columns array.

For instance, an importer webhook response may look something like this:

{
  "webhook_key": "primary",
  "template_key": "contacts",
	...
  "columns": [
    {
      "sheet_column_name": "First Name",
      "template_column_name": "First name",
      "template_column_key": "first_name"
    },
    {
      "sheet_column_name": "Last Name",
      "template_column_name": "Last Name",
      "template_column_key": "last_name"
    },
    {
      "sheet_column_name": "Email",
      "template_column_name": "email",
      "template_column_key": "email"
    },
    {
      "sheet_column_name": "Priority",
      "template_column_name": "Tier",
      "template_column_key": "tier",
      "is_custom": true,
      "custom_column_name": "Priority"
    }
  ],
  "sequence_number": 1,
  "sequence_count": 1,
  "data": {
    "count": 228,
    "records": [
      {
        "last_name": "Goel",
        "$custom": {
          "3": "HIGH"
        },
        "first_name": "Aditi",
        "email": "[email protected]"
      }
      ...
    ],
    "error_records": [
      {
        "data": {
          "$custom": {
            "3": "LOWW"
          },
          "first_name": "Jack",
          "last_name": "Mattson",
          "email": "jackmattson@@@gmail.com"
        },
        "errors": {
          "email": [
            13
          ],
          "$custom": {
            "3": [
              1
            ]
          }
        }
      }
      ...
    ]
  }
}

In this example, "priority" is a custom column. It is the fourth column in the columns Array, so its index is 3. The name given to this column by the user will be in the custom_column_name field of this column in the columns array.