Dynamic data variable based on counter

Hi,

I have a record like this one

{
“1”: {
“arrayValue”: {
“values”: [
{
“stringValue”: “rwerwe”,
“integerValue”: “66”
}
]
}
},
“2”: {
“arrayValue”: {
“values”: [
{
“stringValue”: “erterert”,
“integerValue”: “23”
}
]
}
}
}

I need to go through any elements of the record, 1 and 2 in the example, but many more in the real application to create a list of objects.

To do that, I create a loop using a “counter” variable and I want to iterate the loop until the first undefined record (end of the list).

To read the first value within the record I can use the data variable

data.GlobalReceiptInfo.documents[0].fields[“1”].arrayValue.values[0].integerValue

So, to use the function in a loop I need to replace the field [“1”] with the value of the counter, creating a dynamic data variable based on the “counter” index.

I tried, but without any success.

I’m sure the solution is simple, but I was not able to find it.

Any help is appreciated

Thank you
Giovanni