Supported transformation functions in Destination SDK
Experience Platform Destination SDK uses Pebble templates, allowing you to transform the data exported from Experience Platform into the format required by your destination.
The Experience Platform Pebble implementation has some changes, compared to the out-of-the box version provided by Pebble. Also, in addition to the out-of-the-box functions provided by Pebble, Adobe has created some additional functions that you can use with Destination SDK.
Where to use where-to-use
Use the supported functions listed further below on this page when creating a message transformation template for the data exported out of Experience Platform to your destination.
The message transformation template is used in the destination server configuration for streaming destinations.
Prerequisites prerequisites
To understand the concepts and functions in this reference page, read the message format document first. You need to understand the structure of a profile in Experience Platform before you can use Pebble templates to transform and the exported data.
Before you advance to the functions documented below, review the templating examples in the section Using a templating language for the identity, attributes, and audience membership transformations. The examples in there start off very simple and increase in complexity.
Supported Pebble functions supported-functions
From the Pebble tags section, Destination SDK only supports:
for
is different when iterating through array or map elements in a template. When you iterate through an array, you can obtain the element directly. When you iterate through a map, you obtain each map entry, which has a key-value pair.- For an example of an array element, think about the identities in an identityMap namespace, where you could iterate through elements such as
identityMap.gaid
,identityMap.email
, or similar. - For an example of a map element, think about segmentMembership.
From the Pebble filter section, Destination SDK supports all functions. An example further below shows how the date
function can be used within Destination SDK.
From the Pebble functions section, Adobe does not support the range function.
Example of how the date
function is used date-function
To exemplify how Pebble functions are used in Destination SDK, see below how the date function (link in Pebble documentation) is used to transform the format of a timestamp.
Use case
You want to change the lastQualificationTime
timestamp from the default ISO 8601 value that Experience Platform exports to another value preferred by your destination.
Example
Input
{
"lastQualificationTime": "2022-02-08T18:34:24.000+0000"
}
Format
{{ lastQualificationTime | date(existingFormat="yyyy-MM-dd'T'HH:mm:sss.SSSX", format="yyyy-MM-dd'T'HH:mm:ssX") }}
Output
{
"lastQualificationTime": "2022-02-21T18:34:24Z"
}
Functions added by Adobe functions-added-by-adobe
In addition to the out-of-the-box functions provided by Pebble, see below the additional functions created by Adobe that you can use for your data exports.
addedSegments
and removedSegments
functions addedsegments-removedsegments-functions
Use case
These functions can be used on order to obtain a list of audiences that were added to or removed from a profile.
Example
Input
{
"identityMap": {
"myIdNamespace": [
{
"id": "external_id1"
},
{
"id": "external_id2"
}
]
},
"segmentMembership": {
"ups": {
"111111": {
"lastQualificationTime": "2019-11-20T13:15:49Z",
"status": "realized"
},
"222222": {
"lastQualificationTime": "2019-11-20T13:15:49Z",
"status": "exited"
},
"333333": {
"lastQualificationTime": "2019-11-20T13:15:49Z",
"status": "realized"
}
}
}
}
Format
added: {% for s in addedSegments(segmentMembership.ups) %}<{{s.key}}>{% endfor %}; removed: {% for s in removedSegments(segmentMembership.ups) %}<{{s.key}}>{% endfor %}
Output
added: <111111><333333>; removed: <222222>
Next steps next-steps
You now know which Pebble functions are supported in Destination SDK, as well as how to use them to adjust the format of the exported data to fit your needs. Next, you should review the following pages: