rename

Rename fields in the header.

Introduction

Use the rename enrichment to rename fields in the header of the data extract. Rename fields based on their position in the header or based on the name to change.

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 (*).

Fields*

In the left field, enter the name of the column to be renamed. In the right field, enter the new name for the column. See example 1.

Old name

Enter the name of the column to be renamed. This is an alternative method for renaming the columns, as shown in example 2. Choose one of the following options:

  • String - Select this option and enter the name of the column to be renamed.

  • Integer - Select this option and enter the position in the data extract of the column to be renamed. Counting starts at zero. To select the first column, enter 0. To select the second column, enter 1. To select the last column in the Data Extract, enter -1.

New name

Enter the new name of the column to be renamed.

Strict

Select this option to raise an error if a field could not be found during the enrichment. Leave this field unselected to continue with the enrichment if a field is not found.

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 1

Enrichment configuration

Fields*

Field to rename

Object type

New name

Campaign

String

Campaign Name

Ad Group

String

Ad Type

Clicks

String

Click Through

Data table before enrichment

Campaign

Ad Group

Clicks

Brand

media

7

Brand

ecommerce

7

Dashboard

media

29

Dashboard

media|social

5

Data table after enrichment

Campaign Name

Ad Type

Click Through

Brand

media

7

Brand

ecommerce

7

Dashboard

media

29

Dashboard

media|social

5

Example 2

Enrichment configuration

Old Name

Select Integer and enter 0.

New Name

Select String and enter Campaign Name.

Data table before enrichment

Campaign

Ad Group

Clicks

Brand

media

7

Brand

ecommerce

7

Dashboard

media

29

Dashboard

media|social

5

Data table after enrichment

Campaign Name

Ad Group

Clicks

Brand

media

7

Brand

ecommerce

7

Dashboard

media

29

Dashboard

media|social

5