Question about SetJsonObjectProperty and JSON path navigation

I'm working with JSON objects in Architect and need clarification on 'SetJsonObjectProperty' functionality.

I have a simple JSON structure stored in a variable Flow.dataBus

{
"conversation": {
"active": {
"conversationId": "",
"flowStartDateTimeUtc": "",
"ani": "",
"dialledNumber": "",
"journeyHistory": []
},
"history": {}
},
"event": {}
}

My question: Does SetJsonObjectProperty support specifying a JSON path as the first argument? For example:

SetJsonObjectProperty(Flow.dataBus.conversation.active, "conversationId", Call.ConversationId)

This seems to validate but errors on runtime. Currently, I'm having to use a more verbose approach with nested GetJsonObjectProperty and SetJsonObjectProperty calls. GetJsonObjectProperty allows a path to be defined but I cannot resolve the issue on Set.

Is there a more elegant way to set values at specific paths within a complex JSON structure in Architect?

Thanks

Gordon

@MelissaBailey Curious to understand if you have any thoughts on this? Your posts on Architect expressions are often very insightful.

G

It's a bug that the UI is not showing you an error for doing that. The nested calls is the only way to do what you want.

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