fieldmap

Update your data extract table by mapping existing values into new or existing columns.

Introduction

Use the fieldmap enrichment to update the data extract table by mapping values from existing columns into new or existing columns. You can use python expressions to create new values.

Creating the enrichment

For more information on creating an enrichment, see Using custom scripts.

Configuring the enrichment

To configure the enrichment, fill in the following fields. Required fields are marked with an asterisk (*).

Mapping

Enter the mapping to update your table. Click + to add in another set of mapping fields. Fill in the following fields:

Output field

Enter a name for the new column to be added to the data extract. This column will contain the new, mapped values.

Input field

Enter the name of the column that contains the values with which to populate the new columns. Choose one of the following options from the drop-down field to the left of the Input field:

  • String - Select this option and enter the name of the column in the original data extract. The values from this column are used to populate the new column

  • Python - Select this option and enter a python expression to use only the values that catch the criteria of the expression. For more information on python expressions in custom scripts, see Using Python expressions in custom scripts.

Fail on Error

Select this option to stop the enrichment if an error occurs.

Errorvalue

Enter a value with which to populate a field in the new column if an error occurs. This is to help identify where the error occurred during the mapping.

Subtable

Enter the name for a subtable that you want to contain the enriched data. The enrichment is applied to the whole data extract, then the enriched data is output into the subtable you have named here.

This subtable is a temporary table, which means it only exists for this custom script. You can apply additional instructions within the same custom script to the subtable. However, the subtable cannot be used in any other custom scripts.

Example

Enrichment configuration

Mapping 1

  • Output field = Advert

  • Input field (Python) = {Campaign} + "-" + {Ad Group}

Mapping 2

  • Output field = Ad Clicks

  • Input field (String) = Clicks

ErrorValue

Error

Data table before enrichment

Campaign

Ad Group

Clicks

Brand

media

7

Brand

ecommerce

3

Dashboard

media

Dashboard

media|social

5

Dashboard

media

11

Data table after enrichment

Advert

Ad Clicks

Brand - media

7

Brand - ecommerce

3

Dashboard - media

Error

Dashboard - media|social

5

Dashboard - media

11