I'm guess for that result the value wasn't there, and yes no default is set so we get an error. For First from array you set defaults like so:
"successTemplate": "{ \"tAcw\": ${successTemplateUtils.firstFromArray(\"${tAcw}\", \"0\")} }"
Check out the velocity macro page to see some more examples: https://help.mypurecloud.com/articles/velocity-macros-data-actions/#firstFromArray
Also make sure your output contract have the right types assigned for the values you are mapping.
If you are using a different API than the one In the screenshot then of course the path will be different too.
If able, can you include the raw results output, along with the contract setup and the API url you are using, would help with trouble shooting further.
------------------------------
Anton Vroon
------------------------------
Original Message:
Sent: 01-03-2025 16:26
From: Shirley Byrd
Subject: /api/v2/analytics/conversations/${input.conversationId}/details
Thanks Anton -yes I am using a data action - when I modify using your suggestion I am getting an error -
{ "message": "Transform failed to process result using 'successTemplate' template due to error:'Unexpected character ('}' (code 125)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 11]'\n Template:'{ \"tAcw\": ${successTemplateUtils.firstFromArray(\"${tAcw}\")}}'.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "fee5bced-b253-481a-80d7-45c60ced68e9", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": []}
t
This is what I have for my response
{
"translationMap": {
"tAcw": "$.participants[0].sessions[0].metrics[?(@.name == 'tAcw')].value"
},
"translationMapDefaults": {},
"successTemplate": "{ \"tAcw\": ${successTemplateUtils.firstFromArray(\"${tAcw}\")}}"
}
------------------------------
Shirley Byrd
Network Infrastructure Spec
Original Message:
Sent: 01-02-2025 16:17
From: Anton Vroon
Subject: /api/v2/analytics/conversations/${input.conversationId}/details
I take you are using a data action and just want to assign those to variables in architect?
In your data action you will want something like this under configuration response:

Contracts:

And that should assign tAcw value to a variable tAcw which you can then use in an architect flow as your input to qualtrics data action.

------------------------------
Anton Vroon
Original Message:
Sent: 11-27-2024 10:28
From: Shirley Byrd
Subject: /api/v2/analytics/conversations/${input.conversationId}/details
The data is under the metrics section – I just can figure out how to input the "value" in a variable to do the calculation.
"metrics": [
{
"emitDate": "2024-11-21T20:59:36.592Z",
"name": "tAlert",
"value": 5262
},
{
"emitDate": "2024-11-21T20:59:36.592Z",
"name": "tAnswered",
"value": 5542
},
{
"emitDate": "2024-11-21T20:59:44.788Z",
"name": "tTalk",
"value": 8196
},
{
"emitDate": "2024-11-21T20:59:44.788Z",
"name": "tTalkComplete",
"value": 8196
Original Message:
Sent: 11/27/2024 10:23:00 AM
From: Cameron Tomlin
Subject: RE: /api/v2/analytics/conversations/${input.conversationId}/details
Hello Shirley,
Are you saying you are getting the data just cannot parse it into readable data for Qualtrics?
Or are you missing the data completely?
Cheers,
------------------------------
Cameron
Online Community Manager/Moderator
Original Message:
Sent: 11-27-2024 09:45
From: Shirley Byrd
Subject: /api/v2/analytics/conversations/${input.conversationId}/details
I am trying to pull data to send to Qualtrics using a data action within Genesys using /api/v2/analytics/conversations/${input.conversationId}/details.
I am having trouble parsing the data to get the totals for ttalk, tacw, thandle, thold, tivr
I can't seem to figure out how to get the "value" for each into an update statement for the calculation
#API/Integrations
------------------------------
Shirley Byrd
Network Infrastructure Spec
------------------------------