Thanks Jason. This worked perfectly.
Original Message:
Sent: 06-13-2025 09:45
From: Jason Mathison
Subject: Assistance Required: Retrieving Dynamic Object from Data Action
Looks like thissuccessTemplate": "{\"JSONString\": $esc.jsonEncode(${rawResult}) }"might need escaped quotes around the encoded JSON like this:successTemplate": "{\"JSONString\": \"$esc.jsonEncode(${rawResult})\" }"
------------------------------
--Jason
Original Message:
Sent: 06-13-2025 04:23
From: Vineet Kakroo
Subject: Assistance Required: Retrieving Dynamic Object from Data Action
I am trying a similar data-action but something not working.
I run the get-conversation API in data-action and want to convert all the results into architect where i can then process it as JSON, but I surely am missing something. Any help would be really appreciated.
Input: /api/v2/conversations/calls/${input.ConversationID}
Output: JSONString (type string)
Data Action Response :
{
"translationMap": {
},
"translationMapDefaults": {
},
"successTemplate": "{\"JSONString\": $esc.jsonEncode(${rawResult}) }"
}
Error I get:
Apply output transformation: Transform failed to process result using 'successTemplate' template due to error:'Unexpected character ('\' (code 92)): was expecting double-quote to start field name at [Source: (String)"{"JSONString": {\n \"id\" : \"462772cc-8072-47f4-90e2-d6a07d8ca659\",\n \"participants\" : [ {\n \"id\" : \"b1d01c83-19e5-4476-8dda-67bcf4e95443\",\n \"name\" : \"Mobile Number, United Kingdom\",\n \"address\" : \"tel:+440000000000\",\n \"startTime\" : \"2025-06-13T07:41:02.207Z\",\n \"connectedTime\" : \"2025-06-13T07:41:02.432Z\",\n \"endTime\" : \"2025-06-13T07:50:28.341Z\",\n \"purpose\" : \"customer\",\n \"state\" : \"terminated\",\n \"direction\" : \"inbound\","[truncated 20986 chars]; line: 1, column: 17]' Template:'{"JSONString": $esc.jsonEncode(${rawResult}) }'.
------------------------------
Vineet Kakroo
Senior Technical Consultant
Original Message:
Sent: 06-12-2025 22:54
From: Arulazhagan Ezhini
Subject: Assistance Required: Retrieving Dynamic Object from Data Action
Great.
------------------------------
Arulazhagan Ezhini
Original Message:
Sent: 06-12-2025 09:38
From: Balaji Balakrishnan
Subject: Assistance Required: Retrieving Dynamic Object from Data Action
Hi Jason Mathison,
If I set the ContactData as a String type in the contracts section, I am unable to store the entire object inside ContactData. My intention is to store the entire data object and use it from Architect.
Could you suggest an approach to achieve this while ensuring the full object is retained?
------------------------------
Balaji Balakrishnan
Original Message:
Sent: 06-11-2025 10:26
From: Jason Mathison
Subject: Assistance Required: Retrieving Dynamic Object from Data Action
Architect requires that there be an output contract with specific data types. If the output response is dynamic the I suggest you have a single "string" returned in your output contract. In your data action take the existing response and json escape it. Then in architect you can unescape that string into JSON and work with it as JSON.
------------------------------
--Jason
Original Message:
Sent: 06-10-2025 08:05
From: Balaji Balakrishnan
Subject: Assistance Required: Retrieving Dynamic Object from Data Action
Dear Genesys Developer Community,
I hope you are doing well.
I am reaching out to seek guidance on an issue I am encountering while attempting to retrieve dynamic objects from a Data Action within a workflow/Architect flow. Below are the steps I have followed:
Steps Taken:
Created a Data Action to retrieve contact information using contactID and contactListID. The Data Action is designed to fetch details from a contact list in an object format.
Defined ContactData as an object in the contracts output section to store the retrieved contact details.
Used the following schema to structure the output:
{
"translationMap": {
"contactData": "$.data"
},
"translationMapDefaults": {
"contactData": "UNKNOWN"
},
"successTemplate": "{\r\n \"contactData\": ${contactData} \r\n}"
}
Successfully retrieved the entire data object inside the raw result, storing it in the ContactData object.
Saved and published the Data Action.
Invoked the Data Action inside a workflow/Architect flow, but the output section is not display. 
Issue:
The Data Action does not return the expected dynamic object when used inside the workflow.
I intend to reuse this Data Action to dynamically fetch contact details, but currently, it only shows the input contact.
Request for Assistance:
Has anyone encountered a similar issue? How can I ensure that the Data Action correctly returns the dynamic object inside the workflow? Any suggestions or best practices would be greatly appreciated.
I appreciate your time and support and look forward to your insights.
#Architect
#DataActions
#Triggers
------------------------------
Thanks,
Balaji Balakrishnan
------------------------------