Getting arrays as a result and using them in Architect

I've read (and deep dived) on this in the past where we have to have results that can properly flatten for consumption in Architect. In the past even getting things to flatten an actual JSON array lead to not being able to access the values in Architect even if you could run the data action correctly. To be honest, it's the only place we really get to use the data so it needs to work there if anywhere.

Recently this popped up: https://help.mypurecloud.com/articles/collection-variables/ which makes me think that you're possibly working on making Architect more array friendly which would lead me to believe you're close to allowing JSON array results without flattening in some cases.

If this is something you're working on, is there an ETA guesstimate? I'm working with a customer who would prefer to be able to send back N types of accounts for a single user, with each account having values for type of account, account balance, etc.

In the past we had people jump on the "yeah you can do it with a data action" but that lead (in the past) to non-useful data actions in Architect. Looking to see/hear if that is changing.

Also, feel free to tell me to RTFM as long as the FM covers it. :smile:
Thanks!

Hi Jason,

Have you read this article?

Usually a response can be manipulated in a way that is flattenable for Architect. The response schema shouldn't be "pre-flattened", btw - the flattening is handled on the output from the action.

I'm not aware of any planned updates in the way JSON responses are handled by IVR flows. The recent updates to collections give you more options for manipulating collections once they've been created.

Yeah, it's more nested arrays that still break (at the end of that article). So if there's no plans to create new tools in Architect (because you'd need some there I would think to deal with the nested arrays) and handle that, I'll make sure the customer understands that and then we'll work to have them make sure the data conforms to the needs of PureCloud as it is today.

They asked me (and sent the initial link I posted above) and I wasn't sure so I wanted to ask you.

Hey Jason, it feels like it has been hours since we have been able to chat :slight_smile:

If you can provide an example object and what data you want from it we can see if we can jsonpath it into submission. If the data you need to manipulate is really complex your best bet may be to have a middleware service do the heavy lifting and spoon feed it to architect.

If you have any ideas for how Data Actions could be improved feel free to submit ideas here: https://purecloud.ideas.aha.io

--Jason

1 Like

Hahaha - yeah, it has been ages.

I'll look more into their needs but I think they are developing the service for PureCloud use so I think for now it will be okay for them to change things to work better with how things are.

I may take their initial data return idea and see if I can wrap it up in a larger use case because I do think there are places where if we could deal with arrays better in Architect that it would be useful. It would (I imagine) require several new tools so that you could iterate through and perform logic (is this is a type "X" account?) but it also makes sense to handle those things on the service side - more RESTful without trying to dump everything in one call.

Thanks again!
Jason

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.