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