How to loop thru collections nested in an array? | Community
Skip to main content
gardensurfer
Level 3
August 7, 2024
Question

How to loop thru collections nested in an array?

What is the right way to iterate through this structure (which is the output of an HTTP Request)? I want to iterate thru each variantAssayID in each collection of the array: 

 

 

I tried to use an iterator like this:

 

Instead of the iterator passing variantAssayID 1, then variantAssayID 2, then variantAssayID 3, the iterator just kept repeating variantAssayID 1 for as many times as there were collections in the array. 

 

Halp, please !?!?!?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

ChrisStephens
New Participant
August 8, 2024

You should just need to put 141.Data in the iterator

Translate
gardensurfer
Level 3
August 8, 2024

Hmmm... I tried that first and it didn't seem to work. If I can free up some time I'll try it again. That certainly would be easier!

 

Translate
gardensurfer
Level 3
August 7, 2024

OP here. I figured it out (or at least a workaround). What I did was - in the HTTP Request module, I unchecked the box to Parse JSON, which is what created the "Collections within an Array" structure. 

 

I then took the raw JSON and passed it to a Parse JSON module, which then converted the JSON into bundles instead of collections. From there, I was able to iterate thru the bundles as desired. I can mark this one solved now, but please feel free to offer other ways I could have accomplished what I'd wanted. 

 

Thanks!

 

 

Translate