How to iterate through this array?

I need to iterate through the “person_url” in this datastructure:
example.json (9.1 KB)

The attached JSON is the output bundle from this module:

In the iterator I have a function:

{{toArray(2.data)}}

This doesnt allow me to access the children: key: people

While I was testing the data with a parse JSON module (with the direct output bundle from “get bedrijfsdata”) I was able to access the proper array with the “person_url”

What does your Iterator config look like?

1 Like

I have an inline function

{{toArray(2.data)}}

Did you try putting a Parse JSON before the Iterator, and just put the {{2. data}} as the input? Then for the Iterator, feed it the relevant part of the output from Parse JSON

Yes

And when I put the same inline function toArray() into the parse JSON module it doesnt recognize the JSON.


The data placeholder is not targeting the whole JSON output bundle, its targeting the key: data with the collection inside.

It would probably help for me to understand data structures a bit better, when there is no placeholder to directly select a nested object I get confused, I was able to directly target the people array with the nested objects like so:

{{2.data.people}}

Since this already is an array I dont need to use that toArray function obviously…

1 Like

This usually happens when the module’s interface and samples weren’t supplied by the app developer. You could request that this is added in by opening a feature request.

You can submit this suggestion to the Idea exchange, under
App improvement ideas

Don’t forget to search for it first, just in case someone already suggested it, so that you don’t end up creating a duplicate.
Screenshot_2024-01-17_130153

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

1 Like

this helps for sure, but for me is good to understand data structure too so im happy I found this out like this, it works for many modules with complex data structures in its outputs.

Maybe one more related question: If I want to target the full output bundle and its not in a sample, how could I hardcode this?

[
    { ... }
]

Cheers!

This is best asked as a new thread.