How to work with calculated fields

IMPORTANT
Whenever you work with calculated fields, in addition to any data transformation function that you apply, you must also use the array_to_string function to concatenate fields into a string.

In the mapping step of the activation workflow for cloud storage destinations, select Add calculated field.

TIP
The Add calculated field control is disabled for destination connections where the Export arrays, maps, and objects control was toggled off. Read more.

Add calculated field highlighted in the mapping step of the batch activation workflow.

This opens a modal window where you can select functions and fields to export attributes out of Experience Platform.

Modal window of the calculated field functionality with no function selected yet.

For example, use the array_to_string function on the organizations field as shown below to export the organizations array as a string in a CSV file. View more information about this and other examples further below.

Modal window of the calculated field functionality with the array-to-string function selected.

Select Save to keep the calculated field and return to the mapping step.

Modal window of the calculated field functionality with the array-to-string function selected and the Save control highlighted.

Back in the mapping step of the workflow, fill in the Target field with a value of the column header you want for this field in the exported files.

Mapping step with the target field highlighted.

Select target field 2

When ready, select Next to proceed to the next step of the activation workflow.

Mapping step with the target field highlighted and a target value filled in.

Sample supported functions to perform data transformations

All the documented Data Prep functions are supported when activating data to file-based destinations.

The functions below, specific to handling exports of arrays, or applying hashing to fields, are documented along with examples.

  • array_to_string
  • flattenArray
  • filterArray
  • transformArray
  • coalesce
  • size_of
  • iif
  • index-based array access
  • add_to_array
  • to_array
  • first
  • last