Expand my Community achievements bar.

How to loop thru collections nested in an array?

Avatar

Level 2

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: 

gardensurfer_0-1723068211802.png

 

 

I tried to use an iterator like this:

gardensurfer_2-1723066545044.png

 

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 !?!?!?

 

3 Replies

Avatar

Level 2

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!

 

 

Avatar

Community Advisor

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

Avatar

Level 2

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!