Iterator not processing all attachments

I have created a scenario that exports Survey123 attachments and uploads them to DropBox. One leg of the scenario is exporting attachments from a Repeat section and I am using an iterator to process them; however, the iterator is only processing the first attachment. The output only shows one bundle and in the end it uploads the image twice to dropbox. See images and blueprint below:

S123 - Pre-Con Photos Export (test).blueprint.json (192.4 KB)

You’ve selected a property within an array, so it only “takes” the first item’s value.

If you want all the array items, you need to use the map array function. See the guide on how to use the map function below, but ignore the first/last/get bits.

Alternatively, simply map only the array variable (the one with square brackets), not a “nested” property value:

Combining Map & Get (or First) functions to get Values from Arrays

The built-in functions map, get, first (or `last) allows you to access values within an array containing collections.

First, use the map function on an array, which returns another array of filtered values —
map(array; key; [key for filtering]; [csv-values for filtering])

Then, the built-in function get (or first/last) to get a specific, single item from the resulting array —
get(array; path)

You will get something that looks like these —

{{ get(map(array; "value"; "name"; "content-type"); 1) }}
{{ first(map(array; "value"; "name"; "content-type")) }}

Map Function Parameters: Step-by-Step

To easily remember how to use each of the parameters of the map function, think of it this way:

  1. From this array (of collections),
  2. I want to get all the the values for the property/key named _______,
  3. Where another property/key _______
  4. has the exact case-sensitive value _______

Example

1. From this array (of collections) user_column_data

2. I want to get all the the values for the property/key named string_value

3. Where another property/key column_id

4. has the exact case-sensitive value EMAIL

5. Output


For more information, the documentation for the above functions can be found in the Help Centre and the “Mapping with Arrays” link below. You should also complete the tutorials in the Make Academy, especially Using get() and map() functions as this is the most important knowledge you need to understand so that you can successfully apply it when building scenarios using Make.

Links & Guides

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I’d also recommend going through the Make Academy if you haven’t yet!

Learn Make

How-Tos

Hope this helps! If you are still having trouble, please provide more details.

@samliew

This is a classic iterator behavior issue that trips people up. When the iterator only processes the first attachment instead of all of them, it usually means the array feeding the iterator is not what you think it is.

The most common cause is that the source module is returning a collection with a nested array, and you are mapping the parent collection instead of the actual array field inside it. Open the iterator setup and look at what array you have selected - it should point specifically to the attachments array (something like Attachments[] or files[]), not a wrapper object.

If you used a mapping panel variable that looks right on the surface, check the actual data structure in the execution log by clicking the source module bubble. Sometimes what appears as an array is actually a single collection with sub-items.

Another thing worth checking is whether your source module has a limit setting that is capping results at 1 - some modules default to returning only the first record. Once you confirm the correct array is mapped and the source is returning all items, the iterator should process each attachment as a separate bundle. What module are you using to get the attachments?

Classic iterator issue — the problem is usually that the array feeding the iterator isn’t being parsed correctly and Make is treating the whole attachment list as a single item rather than separate bundles. Worth checking whether the attachment data coming from Survey123 is actually an array or nested inside another structure, since sometimes you need an Array Aggregator before the iterator or need to map a specific path like attachments rather than the parent object. The blueprint would confirm exactly where the input is getting flattened.