Original Message:
Sent: 12-07-2023 04:06
From: Gurwan Duplenne
Subject: dataaction failure
Hello Arnaud,
The error you mentioned is not due to the long execution time, but this is the huge data that is returned back by the API and so triggers an error memory.
From that being said, when you just need partial data, you don't need to return the full json like :
{
"translationMap": {},
"translationMapDefaults": {},
"successTemplate": "${rawResult}"
}
But you would prefer to update your success template as Anton said something like :
{
"translationMap": {
"totalHits": "$.totalHits"
},
"translationMapDefaults": {},
"successTemplate": "{\"totalHits\": ${totalHits}}"
}
I attached your data action updated (https://contentmanagement.mypurecloud.com/document-viewer/#/1/rijzmkow5vhz5dl3yf2akl6aoe),
let us know.
------------------------------
Gurwan Duplenne
Genesys - Employees
Original Message:
Sent: 12-06-2023 11:06
From: Grignon Arnaud
Subject: dataaction failure
Hello everyone,
I am currently using a data action to count the number of calls on a DID in order to calculate a ratio for triggering a recording.
_____
/api/v2/analytics/conversations/details/query
{
"interval": "${input.Interval}",
"paging": {
"pageSize": 25,
"pageNumber": 1
},
"segmentFilters": [
{
"type": "or",
"predicates": [
{
"type": "dimension",
"dimension": "dnis",
"operator": "matches",
"value": "${input.DNI}"
}
]
}
]
}
______
During unit testing, there is no issue, but things get complicated when I move to production.
At the end of the day, the response returns more than 80,000 lines, whereas I only need the "totalhits." Due to the long execution time, the calls fail when invoking the data action in a flow.
How can I optimize the response to get only the total hits or the minimum information?
The interval is calculated like this: append(ToString(MakeDateTime(year(GetCurrentDateTimeUtc()), month(GetCurrentDateTimeUtc()), day(GetCurrentDateTimeUtc()), 00, 00, 00)),"/",ToString(MakeDateTime(year(GetCurrentDateTimeUtc()), month(GetCurrentDateTimeUtc()), day(GetCurrentDateTimeUtc()), 23, 59, 59)))
If I can't optimize the response (even with a pagesize: 1, it remains too long), how can I retrieve the last quarter-hour within the interval? For example, at 10:10:00, I would need the interval 09:45:00-10:00:00.
Thank you for your assistance.
#ArchitectureandDesign
#Integrations
#Routing(ACD/IVR)
#Telephony
------------------------------
Arnaud
------------------------------