Thank you Jerome. Yes this worked, and the only difference I had on my various attempts was that I had not enclosed the $esc.jsonEncode in \". Once I did this, it worked.
Original Message:
Sent: 08-20-2025 02:00
From: Jerome Saint-Marc
Subject: Data Action guidance required for passing past of JSON result as String to Architect
Hello,
According to the response example you have posted, $.results is not the right path. Your structure is named "result".
And as you are trying to retrieve the persons array, you could use this path: $.result.persons
Your response contract should be something like this:
{
"translationMap": {
"personsArray": "$.result.persons"
},
"translationMapDefaults": {
"personsArray": "[]"
},
"successTemplate": "{ \"Result_Information\": \"$esc.jsonEncode(${personsArray})\" }"
}
Regards,
------------------------------
Jerome Saint-Marc
Senior Development Support Engineer
Original Message:
Sent: 08-19-2025 11:03
From: Vineet Kakroo
Subject: Data Action guidance required for passing past of JSON result as String to Architect
Thanks George. Yes I had already check the resource and tried esc.jsonEncode but does not work. Maybe I am missing something.
My output contract looks like;
{
"title": "Output",
"type": "object",
"properties": {
"Result_Information": {
"type": "string"
}
}
}
My response looks like this;
{
"translationMap": {
"Result_Information": "$.results"
},
"translationMapDefaults": {
"Result_Information": ""
},
"successTemplate": "\"Result_Information\": $esc.jsonEncode(${Result_Information})"
}
And based on this I get the error;
Validate output against schema: JSON failed output schema validation because it was malformed JSON. reason: 'Unrecognized token 'Result_Information': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 19]'
------------------------------
Vineet Kakroo
Senior Technical Consultant
Original Message:
Sent: 08-19-2025 10:41
From: George Ganahl
Subject: Data Action guidance required for passing past of JSON result as String to Architect
Take a look at the Resource Center article on Velocity Macros and read up on esc.jsonEncode
You can escape the JSON response output from the data action then unescape the JSON in Architect and use it there
------------------------------
George Ganahl GCCX-AI, GCP, GCSME, ICCE, ICHD, etc.
Technical Adoption Champion
Genesys
2024 Community Member of the Year
Original Message:
Sent: 08-18-2025 04:13
From: Vineet Kakroo
Subject: Data Action guidance required for passing past of JSON result as String to Architect
Hello Community,
I need some guidance to help me understand how I can setup Data Action such that I receive a set of JSON result as String in Architect, which I can then convert back to JSON and use.
My results look something like this;
{
"result": {
"resultSummary": {
"totalMatches": 2,
"complateMatches": 2,
"incompleteMatches": 0
},
"persons": [
{
"firstName": "xyz",
"lastName": "abc",
"contactDetails": [
{
"phoneNumber": "1234567890",
"countryCode": "44",
"phoneType": "mobile",
"contactState": "primary"
},
{
"phoneNumber": "9876543210",
"countryCode": "44",
"phoneType": "mobile",
"contactState": "secondary"
}
]
}
]
}
}
Based on the above I am not able to setup Data Action contact or successTemplate to return the whole of "persons" array structure as an string output. I tried various options but can't seem to get it working. Maybe as there are nested arrays in the results, it has an issue, not sure.
Any guidance would be really appreciated.
Regards
#Unsure/Other
------------------------------
Vineet Kakroo
Senior Technical Consultant
------------------------------