Array of Items in Json not available in scenario mode

I have an API request that outputs in JSON format using a HTTP module. It returns an array of items (items ). In history mode I can clearly see all the items but in scenario mode it only allows me to see (and map) the last item in the list.

Why is this and how can I fix it?

Welcome to the Make community!

How are you “mapping” the array? You might need an array “Iterator” module to create bundles from each array item, or you might want to combine all the items into a primitive variable type like a comma-separated string.

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Output bundles

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

2 Likes

Hi @hollowtree33

Welcome to Make community!

Arrays in Make.com only shows first item and provide access to that item only. To deal with this, you need to use iterator. By adding iterator, you will be able to access each item as “value”.

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

2 Likes

Hi, I have tried using an Iterator and it doesn’t help. It too just provides the last item in the array.

The problem seems to be the last item is the only one that is expressed in scenario mode.

@hollowtree33

In iterator also you will see only one item while mapping, however, in result it will process every value.

Please share the screenshot infering your issue.

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

2 Likes

Like I said earlier, you need to pass items[] into an Array Iterator module to “loop” through all the items.

If you want a specific item only, you can use get, first, or last.

2 Likes

Hi, Yes i have done that but in scenario mode I cannot access individual items. I have only access to one item. Please see screenshot attached.

That’s just sample preview data from of the iterated items from the array. You have to run the scenario to see the bundles being passed on to subsequent modules after this Iterator. Each iteration will have different values based on the current item.

2 Likes

How can I map multiple different items to the next modules. For example; imagine I want to map items 2,3 & 6 to the next module. How do I do that when I can only map this sample data?

You can create a filter that only allows “Bundle order position” values [2, 3, 6] through.

2 Likes

Can you give me a few more details? Is filter a separate module because I am attaching my iterator module in the screenshot below and it only has one field?

Click on the dotted line coming out of the Iterator module to add a filter.

For more information about filters, see https://www.make.com/en/help/scenarios/filtering

2 Likes

@hollowtree33

Please go through the screenshots for your refrence:

  1. This is the array data

Screenshot 2023-12-06 113952

  1. I want to get the value of Item where Iteration is 2, So I can use map function like this:

Note: If you want to get all the values then you can only type the value.

  1. Either you can use iterator, it will show like this:

  1. The output is:

Note: Wherever you will map the filed it will process each value one by one.

  1. You can add filter after iterator to avoid some values like:

Hope this helps you!

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

2 Likes

Thanks but this doesnt seem to be working, I have added 2 iterators, both have filters, filtering to a different bundle number. 1 and 2 respectively, but both results in the scenario mode are the same.

I will attach screenshots of my filters. So you can see, but they return the same value (the last item in the array(like always))


This is fine @hollowtree33

Because map function also gives array, that’s why you can see only one item here also.

Now you can iterate through this array and can map the “value” in your next module.

Remember, During mappings, you will always see only one item whether its an array or its from iterator. but you will get all the output in your results. It will go through every value one by one.

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

How do I map all the values, because I want to get access to all the items?

The problem is, I do not want to filter. I just want access to all the items so I can map them to different parts of my flow.

This seems to be impossible?

@hollowtree33

Its possible! Please share your scenario blueprint.

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

1 Like

@hollowtree33

All 10 results are contained within an array. Therefore, to retrieve all of them, please utilize an iterator.

When I use an iterator, I still only have access to the same one item. It changes nothing.

I cannot map more than that one item to other modules as per my screenshot attached.