Iterator for each array?

Hello Makers!

Quick question: I’m building an automation that scrapes the entire content of a static website and having it output a few components (see an example of it in the first screenshot). The way I’ve prompted GPT4o-mini is to output, for every component but one, in arrays. The problem is I’d have to produce a router for each output and create an iterator for each array to be broken down into bundles which I then can feed into a specific column of the Google Sheet.

Is there a method that allows me to achieve my goal without having to create an iterator for each arrays output (5 of the 6 components I need an LLM to output)? Currently not looking to change the prompt because each component that outputs as an array has multiple parts that I need to then distribute to Google Sheets and eventually format it in Markdown to appropriately format it in Google Docs.

Thanks for the help!


If each array has the same length, then you only need one iterator to iterate one of the arrays, and you can still reference the other respective array element’s items using the “bundle order position” variable.

Hope this helps! Let me know if there are any further questions or issues.
Note: I see hundreds of posts, notifications, and messages daily on this forum, so if I missed your reply, please message me to look at your reply.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

Thank you so much @samliew!

This is the first time I’ve been exposed to the “Bundle order position” variable. Each array doesn’t have the same length but most do.

Is there a specific formula or variable from the “functions for working with arrays” table I need to use to retrieve a specific set of bundles? For example, if I wanted to iterate and then map the fields for the “Core Offerings” purple field from the Parse JSON module to the Google Sheets, how would I achieve that?

Or, do I map the “Core Offerings” + “Bundle Order Position” dynamic variable inside of the Google sheet like so?

Thank you in advance for all the help!

Welcome to the Make community!

You can use the built-in function get

e.g.: 2 being the array index (bundle order position can be used here)

{{ get(1.array; 2) }}

For more information, see the function documentation in the Help Center.

Hope this helps! Let me know if there are any further questions or issues.
Note: I see hundreds of posts, notifications, and messages daily on this forum, so if I missed your reply, please message me to look at your reply.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

2 Likes

Thank you so much, please consider this resolved!

Awesome! And check the Make Newbies for Video series if you want to learn more about manipualtion of data structures in make.


Alex Sirota
Director of NewPath Consulting

:heart_on_fire: Check out Make for Make Newbies Video Series :heart_on_fire:

My Solutions on Make Community

Alex, thank you so much for sharing this video. I’ll figure out how to extract the transcript of this video as Vimeo isn’t allowing me to copy and paste but this is such a comprehensive understanding of arrays and collections!

Would really appreciate if you could take a peak at my dilemma under this Make post: Formula for Collections

Thanks to Sam, I have a general understanding of using formulas to extract aspects of an array. My issue now is isolating aspects of a collection using a formula to isolate specific variables inside of a collection (For example, in FAQs collection output (consistently 5 outputs), I want to isolate the 5 “question” variables specifically.

Do you need a text transcript of the video?

I’ll have a look, but I’d like to know if the video series helps you first.

Hey again Alex,

Just loaded the information requested in the other chat we have regarding collections. As for the video you’ve provided, it’s extremely valuable in helping me understand arrays, collections, and JSON parsing better than before! I got up to minute 22 and a few seconds and I didn’t see a portion of it speaking about isolating bundles in collections through a formula which is what I need for the ‘Collections’ inquiry I’ve made in a separate post.

The whole video series is worth to review so you can understand the various functions you can use to access parts of an array or the collection contents. I know you want to get to a solution quickly but understanding the fundamentals of data structure management is pretty much the most important thing to learn about Make. If you start poking it without that core understanding you’ll get very frustrated, very quickly.

I appreciate this a lot Alex. Hence why I definitely need to watch it and internalize it this weekend. I’m already feeling the frustration and I know I’ll need to understand it especially when building more automations on top of the website audit I’m working on!