Read collection with item name

Here’s the JSON response I’ve trying to read

{“query”:{“codes”:[“90210”],“country”:“us”},“results”:{“90210”:[{“postal_code”:“90210”,“country_code”:“US”,“latitude”:34.0901,“longitude”:-118.4065,“city”:“Beverly Hills”,“state”:“California”,“city_en”:“Beverly Hills”,“state_en”:“California”,“state_code”:“CA”}]}}

I need to read results->90210
90210 is stored in another item. Can I have nested items something like
{{2. Data.results.{{1.zipcode}}.state}}

Welcome to the Make community!

I think you can map variables within the built-in map function.

{{first(map(2.Data.results; "state"; "zipcode"; 1.zipcode))}}

For more information, see

Links

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

General

Help Center Basics

2 Likes