Hi
I'm using a data action to retrieve participant data entered email) from a messenger interaction to be used in a survey flow.
The problem I have is I cant for the life of me get the output right - The attribute when run on the API explorer is as below:
participants.attributes.Passed_Email.
Here is my translationmap
{
"translationMap": {
"Email": "$.participants.attributes.Passed_Email"
},
"translationMapDefaults": {
"Email": """"
},
"successTemplate": "{"Email": ${Email}}"
}
This JSONPath Expression searches for Passed_Email attribute under each participants - $.participants[*].attributes.Passed_Email
It returns an array of values.
This velocity macro allows extracting the first value from the array (and use the "NOT FOUND" as default value if the attribute is not there). ${successTemplateUtils.firstFromArray(\"${emailArray}\", \"${esc.quote}NOT FOUND${esc.quote}\")}