0

Building a journey with an API entry event - cannot find any documentation on how to extract the data elements in the REST API Json payload (that's sent under the Data: attribute). Using this documentation to trigger the journey event: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/postEvent.htm

Cannot use the data extension connected to the journey because my Json payload contains multi element array information. And as far as I know data extensions are flat structures.

I realize we have to use GTL to unpack the elements but what would be the first variable to reference to extract the data from the json payload?

2
  • Please provide example of your payload - this will make it easier for us to provide you with help Commented Mar 11, 2020 at 23:37
  • Sure, using the example in the documentation: { "ContactKey": "ID601", "EventDefinitionKey":"AcmeBank-AccountAccessed", "Data": { "accountNumber":"123456", "patronName":"John Smith" } } So my question would be how to access the accountNumber and patronName in my Journey Builder email activity using GTL? Thank you!
    – KavitaGem
    Commented Mar 12, 2020 at 12:39

1 Answer 1

0

You can simply use AttributeValue function. GTL is not needed:

var @patronName
set @patronName = AttributeValue("patronName")

You should create a data extension with field names corresponding parameter names sent in your payload. You should follow this guide for creating one.

If you intend to use multi level structures within each attribute, you can’t place additional levels of JSON there, but should use XML instead. You can then parse it using BuildRowsetFromXML function.

4
  • Would this support array elements? If my JSON has multiple values for one attribute? For example: { "TemplateElementId": "VEHICLE_NAME_ITEM", "TemplateElementValue": "2013 HYUND SONATA GLS" }, { "TemplateElementId": "VEHICLE_NAME_ITEM", "TemplateElementValue": "2012 FORD F250 SUPER DUTY" }, { "TemplateElementId": "VEHICLE_NAME_ITEM", "TemplateElementValue": "2017 WINNE OTHER" }
    – KavitaGem
    Commented Mar 12, 2020 at 13:28
  • This will not work, @KavitaGem - please see my updated answer Commented Mar 12, 2020 at 13:58
  • thanks for the guidance
    – KavitaGem
    Commented Mar 12, 2020 at 16:17
  • You’re welcome @KavitaGem - remember to mark the answer as accepted if it has been helpful Commented Mar 12, 2020 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .