Igor_Llanten | 2023-07-20 19:18:22 UTC | #1
hi Community
I have the following JSON as a response from a data action.
{ "receptionists": [ { "name": "Giovanni Fuenzalida Herrera", "workshopId": 232, "active": true, "id": 7599, "time": 30, "scheduleId": "HCP", "validsBrands": [ "NI", "IF" ] }, { "name": "CLAUDIO ANTONIO CABRERA MIRANDA", "workshopId": 232, "active": true, "id": 1901, "time": 30, "scheduleId": "HCP", "validsBrands": [ "NI", "IF" ] }, { "name": "Diego Andres Contreras Zambrano", "workshopId": 232, "active": true, "id": 4427, "time": 30, "scheduleId": "HCP", "validsBrands": [ "NI" ] }, { "name": "ASESOR LA DEHESA", "workshopId": 232, "active": true, "id": 23108, "time": 30, "scheduleId": "MG", "validsBrands": [ "MG" ] }, { "name": "DIEGO LEONARDO CAMPROVIN AROS", "workshopId": 232, "active": true, "id": 5549, "time": 30, "scheduleId": "HCP", "validsBrands": [ "NI", "IF" ] } ] }
From the response json, I need to filter the names of the objects that have the code 'NI' as validBrands
I have managed to do it using this code inside "translationMap"
{ "translationMap": { "name": "$.receptionists[?('NI' in @.validsBrands)].name", "workshopId": "$.receptionists[?('NI' in @.validsBrands)].workshopId", "id": "$.receptionists[?('NI' in @.validsBrands)].id" }, "translationMapDefaults": { "name": "[]", "workshopId": "[]", "id": "[]" }, "successTemplate": "{ \n \n \"name\":${name} \n, \n \"workshopId\":${workshopId} \n, \n \"id\":${id} \n }"
Now the question goes to how can I adjust the code of translationMap ($.receptionists[?('NI' in @.validsBrands)].name) so that it can accept any other code for validsBrands (example MG)
Jerome.Saint-Marc | 2023-07-21 06:04:35 UTC | #2
Hello,
Input parameters are not available while handling the response (not available in the Response configuration translationMap).
There is a Genesys Cloud idea you can vote for: https://genesyscloud.ideas.aha.io/ideas/OTB-I-224
Regards,
system | 2023-08-21 06:04:55 UTC | #3
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 21095