Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Finding value deep down in a json structure

Svante Gustafsson Björkegren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2025

Hey, 

I am trying to fetch a value inside a JSON structure and I cannot get it right. Maybe this community can give me a hint how to write my smart value variables for this use case

Background: I have read up a bunch of Assets objects via the Assets REST API end point: /object/aql. The webResponse is an array of objects under the "values" tag. 

I create a branch from the {{webResponse.body.values}} smart value and call the branch variable myObject. So far so good. In each object structure in the array there is an attributes-array called attributes. In this array I need to get the value for an attribute with a specific attribute-id. 

The structure looks like this (simplified):

{
"values": [
{
"id": "20",
"attributes": [
{
"objectTypeAttributeId": "4839",
"objectAttributeValues": [
{
"displayValue": "Some attribute value"
}
]
},
{
"objectTypeAttributeId": "4853",
"objectAttributeValues": [
{
"displayValue": "This is my value to fetch"
}
]
}
]
},
{
"id": "21",
--- the next object ---

In my branch I create a variable to get the attribute array:

varAttributes --> {{myObject.attributes}}

This works fine. But I can't get down to the requested attribute-id from here. I would like to create a variable that gives me the value "This is my value to fetch", i.e. the value from the attribute with ID "4853".

I have tried a number of variants of setting a new variable to something like: {{#varAttributes}}{{.}}{{/}} and some if-clause that tests for the ID value, but I can't get it right.

Looking forward to hear back from you!

Cheers,
// Svante

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events