Hi everyone!
I'm trying to find the index of a specific domain in my API response array. Here's what I have:
- An API response that returns data in this structure:
{
"retornoData": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "127.0.0.1:3000"
}
]
}
],
"match": [
{
"host": [
"example1.domain.com"
]
}
],
"terminal": true
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "127.0.0.1:3000"
}
]
}
],
"match": [
{
"host": [
"example2.domain.com"
]
}
],
"terminal": true
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "127.0.0.1:3000"
}
]
}
],
"match": [
{
"host": [
"example3.domain.com"
]
}
],
"terminal": true
}
]
}
- My Flow setup:
- API Action that gets this data
- Create Array List (domainList) with the API response
- Get Array List Index to find a specific domain's position
I've tried several approaches:
match[0].host[0] == 'example3.domain.com'
.match[0].host[0] == 'example3.domain.com'
host[0] == 'example3.domain.com'
But I keep getting this error:
{
"status": "500",
"message": "arraylist.get: index is required.",
"stack": "Error: arraylist.get: index is required.\n at App.parseRequired (/opt/node_app/lib/core/app.js:759:13)\n at exports.get (/opt/node_app/lib/modules/arraylist.js:41:22)"
}
I need to find the index of a specific domain in this array. For example, if I search for "example2.domain.com", it should return 1 (the second position in the array).
What's the correct syntax to use Get Array List Index in this case?
Thank you for your help!