All Collections
Advanced Topics
Advanced Import mapping & transformations
Advanced Import mapping & transformations

When data should be modified during import or trigger actions like categorization or user group assignment, use import mapping

Michael Fatica avatar
Written by Michael Fatica
Updated over a week ago

This article describes features available to Enterprise users only.

User Group Mapping

When importing data, you can combine field and field value specifications to automatically assign a row to a user group.

For example, if the Division column contains the value 'retail', assign the row to the User Group with ID 1, if the Division column contains the value 'commercial', assign the row to the User Group with ID 2.

Wildcards are supported in the value field. E.g. retail* would match any value starting with the word retail, e.g. retailers, retailor. The value gr[ae]y would match grey or gray.

Under Tools > Import Mapping, the following screen lists any existing mappings. To create a new mapping, click New.

The first example above would require a mapping as shown:

If the Existing Mapping Type is empty, enter UserGroupId as a New Mapping Type.

Category Mapping

In some cases, users would like rows to be added to a category if a field contains a certain value. This is mapping type is Category.

For example, if the FavoriteColor column contains the value 'red', assign the row to the category with ID 25, if the FavoriteColor column contains the value 'blue', assign the row to the category with ID 26.

Wildcards are supported in the value field. E.g. red* would match any value starting with the word red, e.g. reddit, redacted. The value gr[ae]y would match grey or gray and so forth.

When trying to map a column that is not a field, but instead a category column, the "Field Name" must be tag1. This mapping would then only apply to categories that appeared in the first category column.

Transformation Mapping

If a value should be modified on the fly during the bulk import, a Twig template can be applied to the data. The only fields that apply to Transformation-type mappings are the Field Name, Mapping Type and the Transformation as shown below. The mapping type must be set to Transformation.

The template is a Twig template, which can perform simple (and not-so-simple) transformations of the incoming data.

A few examples:

Replace any dashes found in the field value with dots:

{{ template_item.value|replace({'-':'.'}) }}

Remove any values greater than 5 characters in length:

{% if template_item.value|length <= 5 %}{{template_item.value}}{% endif %}

Remove any email fields without an @ sign.

{% if '@' in template_item.value %}{{template_item.value}}{% endif %}


Concatenate two fields into the Name field

{% if template_item.data.firstname}{{template_item.data.firstname}} {{template_item.data.lastname}}{% endif %} 

Linking Mappings

Import Mappings can not be linked, or otherwise inform one-another. For example, you can not use a Transformation Mapping to modify a field value, and then create a Category Mapping based on the results of the Transformation Mapping. All mapping rules operate on the data as it appears in the import file.

Did this answer your question?