Process one by one the N elements of a collection

I have a HTTP module that generates a output that is mapped to JSON. I want to process the wellow marked items:

1

As said I want to process each collection. As I haven´t seen any other method (I don´t know how to access the Nth child of a collection) I apply an Iterator. But iterators require arrays, thus I make a toArray() to the tweets collection Resulting in an array of 3 elements:

4

To here all is right. The problem arises when I try to access the arrays elements. Make.com can´t learn the structure under the value of the element of every array Item. Showing this in the selector panel

3

I have tryed to run the scenario a few times, and to reload the page but it doesn´t want to learn the sctructure under value, despite this is a simple collection. What can I do?

1.- Is there an easy way to transform the n elements of a collection to n bundles so I can process them one by one?
2.- ¿Why the [1] is showing and make com can´t understand or learn the collection structure despite I have tried almost everything?

Thanks in advance.

I think the way you are doing it is the best way, there are a few alternatives way to do it, but toArray is meant for such use cases.

This is a somewhat repeatedly occurring issue with Make and a rather frustrating one as well, Sometime it immediately picks up such a dynamic collection with ease and most of the time it refuses to render the collection values . The way I try to solve this is to run the scenario once, save reload and see if it works. You tried this already, so, maybe what you can do is, either remove those modules and re-add them and see if that fixes the issue.

If it still doesn’t work them what you can do is utilize map function for mapping as well.

1 Like

Thanks for your replay. Not saving nor reloading has worked. Also not creating the scenario again (from blank). For any reason Make.com decline to understand de structure.

I have also tryed to map, blindly, the “un-understanded” object but make.com can´t. Says: “The operation failed with an error. Failed to map ‘text’: Function ‘map’ finished with error! ‘{object}’ is not a valid array.” despite Value is an array.

There must be a method to access the childs (elements) of a JSON node (a collection)… :disappointed_relieved:

hi @Ramon_E

watch out; ‘value’ is not an array according to the screenshot:

try getting full_text with this function: map(theValueCollection;full_text)

1 Like

Thanks to all.
Finally solved. I Post here the solution.
1.- Scenario

2

3
2.- Execution

Steps: save as a variable the to_Array() of the Collection. As simple as this. Then later yo can read the variable as an Array thus process element by element in an iterator.

1 Like

Hi @Ramon_E happy Friday :wave:

I just wanted to drop in and say a big thanks for taking the time to share the solution you arrived at with the assistance of @Runcorn and @Loopz! It’s super valuable and much appreciated :pray:

Just FYI: I’ve marked your last comment as the solution to help keep everything nice and organized in the community. This way, other folks can easily find the answer they’re looking for.

1 Like