Utility functions
Here's a list of utility functions you can call in an audience export.
${concat(separatorString, firstString, secondString)}
This function returns a string created by appending the second string to the end of the first string. You can specify a separator string between the two strings.
Consider a guest's country and city in the guest profile:
{
"country": "IE",
"city": "Dublin"
}
You can concatenate the values for country and city and include the concatenated string in the output by entering the following into an Attribute value field on the Output structure tab:
${concat("_", guest.country, guest.city)}
For the guest profile in the example above, the return value will be "IE_Dublin"
.
${getDataExtension(extObj, extName, extKey[, fallback])}
This function returns a data extension value available in the guest profile.
MemberCardCategory
Consider a guest profile with the following data extension object:
You can access the value for MemberCardCategory
and include it in the output by entering the following into an Attribute value field on the Output structure tab:
${getDataExtension(guest.dataExtensions, "ext1", "MemberCardCategory", "not-available")}
For the guest profile in the example above, the return value will be "premium"
.
For a guest profile that doesn't have this data extension, the return value will be "not-available"
.
${getIdentifier(identifiersObj, provider[, fallback])}
This function returns the guest's identifier ID if available in the guest profile.
Consider a guest's identifiers
array of objects in the guest profile:
{
"identifiers": [
{
"ref": "3d67f887-9e6f-55c7-9390-027e3fff5595",
"createdAt": "2025-05-31T15:12:22.947Z",
"modifiedAt": "2025-05-31T15:12:22.947Z",
"provider": "BXLP",
"id": "3bb8fb2092d1"
}
]
}
You can include the value for identifiers.id
in the output by entering the following into an Attribute value field on the Output structure tab:
${getIdentifier(guest.identifiers, "BXLP", "not-available")}
For the guest profile in the example above, the return value will be "3bb8fb2092d1"
.
For a guest profile that doesn't have these identifiers, the return value will be "not-available"
.
${formatDate(date, locale[, timezone])}
This function formats an ISO date into a date that's easier to read, using the date format of your choice.
Consider a guest's date of birth in the guest profile:
{
"dateOfBirth": "1984-04-15T01:04:00.000Z"
}
You can format this date for the US English date format and include it in the output by entering the following into an Attribute value field on the Output structure tab:
${formatDate(guest.dateOfBirth, "en-US")}
For the guest profile in the example above, the return value will be "4/15/1984"
.
${formatTime(time, locale[, timezone])}
This function formats an ISO date into a time that's easier to read, using the time format of your choice.
Consider a guest's date of birth in the guest profile:
{
"dateOfBirth": "1984-04-15T01:04:00.000Z"
}
You can format this date for the US English time format and include it in the output by entering the following into an Attribute value field on the Output structure tab:
${formatTime(guest.dateOfBirth, "en-US")}
For the guest profile in the example above, the return value will be "3:04:00 AM"
.
${formatDateTime(time, locale[, timezone])}
This function formats an ISO date into a date and time that's easier to read, using the date and time format of your choice.
Consider a guest's date of birth in the guest profile:
{
"dateOfBirth": "1984-04-15T01:04:00.000Z"
}
You can format this date for the US English date and time format and include it in the output by entering the following into an Attribute value field on the Output structure tab:
${formatDateTime(guest.dateOfBirth, "en-US")}
For the guest profile in the example above, the return value will be "4/15/1984, 3:04:00 AM"
.
${sha256(value)}
This function hashes a value using the SHA-256 algorithm to ensure that data is securely exported.
Consider a guest's email address in the guest profile:
{
"email": "[email protected]"
}
You can hash this email address and include it in the output by entering the following into an Attribute value field on the Output structure tab:
${sha256(guest.email)}
For the guest profile in the example above, the return value will be hashed and securely exported.