convertallx
Convert all the values in a data extract using a Python expression.
Introduction
Use the convertallx enrichment instruction to convert all the values in a data extract using a Python expression.
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 (*).
-
Python Expression
-
Enter a Python expression to use as a converter. For a full list of compatible converters, see the Python documentation.
-
Fail on Error
-
Select this field to stop the enrichment instruction if the conversion cannot be applied.
Example
Enrichment configuration
To remove leading and trailing characters from values in the table, use the Python strip
function.
-
Python Expression
-
{_value}.strip('_')
Data tables before enrichment
Campaign |
Ad Group |
Clicks |
---|---|---|
_brand |
media_ |
75856 |
_outreach |
weekend_ecommerce_ |
38753 |
_organic_growth |
socials_ |
99651 |
Data tables before enrichment
Campaign |
Ad Group |
Clicks |
---|---|---|
brand |
media |
75856 |
outreach |
weekend_ecommerce |
38753 |
organic_growth |
socials |
99651 |