Sorry if I might have missed that already being clear - just flew over the last replies in the thread.
Original Message:
Sent: 11-21-2025 03:14
From: Michael Lukoschek
Subject: GetJsonObjectProperty - working with array of objects
I have no experience with arrays inside a JSON object, but it is possible to address (first level) properties of a JSON object in architect just with normal object notation. Flow.MyPets.pets definitely works to address simple variable type objects. You could at least try to address an array like that also. At least array notation is as well available in Architect: Flow.MyPets.pets[xyz]
------------------------------
Michael Lukoschek
NA
Original Message:
Sent: 11-19-2025 16:03
From: Anton Vroon
Subject: GetJsonObjectProperty - working with array of objects
As far as I'm aware JSON path is not fully supported in Architect - I had created an idea for it, but got marked as Will not Implement- https://genesyscloud.ideas.aha.io/ideas/SSAAOB-I-250
GetJsonObjectProperty works for getting an object fine, but just not for filtering
So in my above example GetJsonObjectProperty(Flow.MyPets, "pets") does work returning an array object, which I could set to a Json collection variable, and then loop through the collection like I would any other collection. This is the method I've been using, start with a json collection iterate through it in a loop and build my new json collection variable with just the items I want.
Annoying yes, and if anyone has a better method also keen to hear it.
------------------------------
Anton Vroon
Original Message:
Sent: 11-19-2025 15:49
From: Jeff Stevens
Subject: GetJsonObjectProperty - working with array of objects
I too seem to be missing something fundamental.
Using @Jason Mathison's JSONPath syntax recommendation(s), Architect only seems to return NOT_SET values. Are there any working examples of actually using GetJsonObjectProperty that returns the selected values as a JSON array?
Note: This resolves fine on the evaluation tool, just not in the flow. Is this an Architect limitation, resolving the pathing syntax, expecting only a single propertyName?
------------------------------
Jeff Stevens
Original Message:
Sent: 05-19-2025 08:29
From: Jason Mathison
Subject: GetJsonObjectProperty - working with array of objects
I typically do my testing with https://www.javainuse.com/jsonpath (disclaimer: neither Genesys nor I have anything to do with this site)
Putting in your example I came up with a few ways to get an array of pet names:
pets..Name
pets[*].Name
$..Name
In my opinion the first two examples are easier to read and less likely to break if additional Name fields are added to the response.
------------------------------
--Jason
Original Message:
Sent: 05-18-2025 18:45
From: Anton Vroon
Subject: GetJsonObjectProperty - working with array of objects
I've been dabbling with JSON paths in architect, the part I become stuck at, and would appreciate some guidance is when I'm working with an array of objects.
I can get that nested array of objects with GetJsonObjectProperty easy enough, but then getting an array from one of the fields withing that object array it all falls apart.
Take something easy like:
{ "name": "bob", "pets": [ { "Type": "cat", "Name": "paws", "age": "4" }, { "Type": "dog", "Name": "tails", "age": "5" } ]}
The output I'm after is an array of pet names
I can get the array of pets with something like GetJsonObjectProperty(Flow.MyPets, "pets") where Flow.MyPets is the above json object.
But then getting just an array of names seems to escape me. I can't just do GetJsonObjectProperty(Flow.petsArray, "Name") or Flow.petsArray.Name etc.
I am missing something fundamental, and basic here, but my brain just isn't processing this, any guidance would be appreciated.
#Architect
------------------------------
Anton Vroon
------------------------------