somik.mukherjee | 2021-12-03 18:33:12 UTC | #1
Hi Team,
We have a data action that returns below result:
{ "servicers": [{ "name": "TEST SERVICE CO", "id": "0018801", "phoneNumber": "81200004168", "ranking": "65.0", "address": { "street": "650 Missouri Ave", "aux": "", "city": "Clarksville", "state": "Indiana", "zip": "47129" }, "oemAuthorized": false, "appointments": [{ "appointmentStartTime": "12:00 PM", "appointmentEndTime": "5:00 PM", "date": "2021-11-04T00:00:00", "id": "64196870", "groupId": "311399" }, { "appointmentStartTime": "8:00 AM", "appointmentEndTime": "5:00 PM", "date": "2021-11-05T00:00:00", "id": "64196870", "groupId": "311399" }, { "appointmentStartTime": "12:00 PM", "appointmentEndTime": "5:00 PM", "date": "2021-11-08T00:00:00", "id": "64196870", "groupId": "311399" }, { "appointmentStartTime": "8:00 AM", "appointmentEndTime": "5:00 PM", "date": "2021-11-08T00:00:00", "id": "64196870", "groupId": "311399" }, { "appointmentStartTime": "8:00 AM", "appointmentEndTime": "5:00 PM", "date": "2021-11-04T00:00:00", "id": "64196870", "groupId": "311399" } ], "servicerType": 1, "status": "Active" }, { "name": "CALLAHANS APPLIANCE INC", "id": "0075397", "phoneNumber": "8883198311", "ranking": "61.54", "address": { "street": "204 W 5TH St", "aux": "", "city": "Prosper", "state": "Texas", "zip": "75078" },
"oemAuthorized": false, "appointments": [{ "appointmentStartTime": "8:00 AM", "appointmentEndTime": "5:00 PM", "date": "2021-11-05T00:00:00", "id": "64196870", "groupId": "292844" }, { "appointmentStartTime": "8:00 AM", "appointmentEndTime": "5:00 PM", "date": "2021-11-04T00:00:00", "id": "64196870", "groupId": "292844" }, { "appointmentStartTime": "8:00 AM", "appointmentEndTime": "5:00 PM", "date": "2021-11-08T00:00:00", "id": "64196870", "groupId": "292844" }, { "appointmentStartTime": "8:00 AM", "appointmentEndTime": "5:00 PM", "date": "2021-11-03T00:00:00", "id": "64196870", "groupId": "292844" } ], "servicerType": 1, "status": "Active" } ],
"success": true, "resultMessages": null, "responseIdentifier": "00000000-0000-0000-0000-000000000000" }
When we are trying to create data action within our BOT flows, it is displaying the success output as a collection. However, when we try to do any action like count, looping, printing using communicate block, etc. they all seems to error out the flow. Below are the fields:
appointmentStartTime**
appointmentEndTime **
date**
id**
groupId**
I have un-flattened the output in Actions->Test and able to generate them successfully. No alteration has been made within the translation map:
{ "translationMap": {}, "translationMapDefaults": {}, "successTemplate": "${rawResult}" }
Please suggest a way to allow displaying all the highlighted 5 fields as a collection.
Thanks, Somik Mukherjee
anon11147534 | 2021-11-01 16:52:11 UTC | #2
Hi Somik,
Can you please post the error message so we can try to debug this issue.
somik.mukherjee | 2021-11-02 03:12:54 UTC | #3
Hi Ronan,
When I am flattening, getting the below error:
{ "message": "Cannot flatten schemas with nested arrays!", "code": "invalid.schema", "status": 400, "messageParams": {}, "contextId": "833b09a7-8b73-4487-ab90-7ae6822bfd62", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": [] }
However, when un-flattened, we see the data but in Architect, any operation takes it to default error message:
Sorry, an error occurred. One moment, please, while I put you through to someone who can help.
This is an error event message that is default.
Thanks, Somik Mukherjee
Jason_Mathison | 2021-11-02 14:00:37 UTC | #4
Hi Somik,
Flattening does not support nested arrays, and Architect always uses flattening, so you will have to change your output schema to be flattening compatible.
--Jason
Henry.Zambrano | 2021-12-03 14:01:39 UTC | #5
Hi Jason but it was working before, we were not receiving that response "Cannot flatten schemas with nested arrays! " why did Genesys change it?
Jason_Mathison | 2021-12-03 15:34:42 UTC | #6
Flattening has never been able to properly handle an array inside of an array, although we have definitely had to tweak the behavior of flattening numerous times over the years.
Is it possible that the structure of your response changed to now include embedded arrays? Are you just now trying to use this in architect which requires flattening, or are you saying that this was working in architect until recently? If it seems to be a recent change in behavior can you figure out when the change in behavior started?
--Jason
Henry.Zambrano | 2021-12-03 15:47:26 UTC | #7
No, the response has not changed. And despite the documentation says that nested array are not supported I was able to receive the nested array values as an string separated by commas. This has been working and until a couple of days ago (maybe weeks) but now I realized that we are getting an error saying "Cannot flatten schemas with nested arrays! " invalid.schema Something had to have changed on your side to make sure you are not supporting nested arrays. I will need to deal with translation maps but it would be good if there's an announcement from Genesys describing this change.
Jason_Mathison | 2021-12-03 18:36:13 UTC | #8
Please post an export of your action with anything sensitive redacted, or open a support case for this issue so we can see exactly what is going on.
--Jason
Henry.Zambrano | 2021-12-03 19:44:36 UTC | #9
The following is a typical response we receive and we were able to handle perfectly with the output contract which has an array of objects which has as one of their properties is another array of objects (statuses).
Henry.Zambrano | 2021-12-09 20:18:45 UTC | #10
I think that the response that we are now getting from Genesys is new: "Cannot flatten schemas with nested arrays!" We were not receiving that response until a couple of weeks ago.
Jason_Mathison | 2021-12-10 16:50:29 UTC | #11
We did make a change around flattening recently that may be causing what you are seeing. Please post an export of your data action, with anything sensitive redacted or open a support case so we can work with you on this issue.
--Jason
Henry.Zambrano | 2021-12-10 16:59:57 UTC | #12
Thank you Jason, I was just curious why it was working before and now we get that error but anyway, I understand that nested arrays are not supported so I'm modifying the output using a translation map to avoid the error.
Jason_Mathison | 2021-12-10 21:08:06 UTC | #13
As far as I understand it, what changed is that we verify that your output contract is valid earlier on in the process. Otherwise you could run into much more difficult to troubleshoot failures at runtime instead. AFAIK there shouldn't be any change in what we do or don't support.
--Jason
system | 2022-01-10 21:09:04 UTC | #14
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: 12521