Share feedback, ideas and get community help

Updated 2 months ago

HTTP Request to Array to Button

Hi!
I am trying to wrap my head around why an array from a http request is not saved.
I want the user to input his zipcode, then a request is ran against my API which returns an array of possible cities. Those are then presented to the user to select one (dynamic data).

Sample Return from the API:
{
"statusCode": 200,
"data": {
"75001": {
"zipcode": "75001",
"cities": [
"PARIS-01",
"PARIS-1ER-ARRONDISSEMENT"
]
}
}
}

Save in Variables:
data.75001.cities
as "cities"

Result: Nothing saves in "cities"

Thanks for your help!
B
l
3 comments
Thanks it is indeed an issue. You should type: data["75001"].cities instead
@Baptiste Thank you. I confirm that it is working with your suggestions
for future reference, in the end i used data["{{zipcode}}"].cities to reflect the dynamic part of the API response
Add a reply
Sign up and join the conversation on Discord