Thanks for the shoutout to me & my Make referral link!
This is kind of a tricky problem to solve, but the solution shows off the true power of Make.
The problem here is that once you iterate your array in module #24, Make treats each iteration of the array as a brand new bundle that will be completely processed by the rest of the iterator’s path. (In your case, you only have one path, so the iterator’s path is the rest of the scenario.)
So even though you’re trying to aggregate the search module (#14) with the array aggregator (#27), it’s too late at that point because the iterator module is overriding both your search & aggregator modules.
In other words, the iterator module wants to finish each one of its bundles through the rest of the scenario, so it’s pushing each one of its bundles all the way through to the very end of the scenario. (It’s doing this because you only have one path. You could solve this problem with multiple paths, which I will show you how to do below.)
So by the time you get to your search module (#14), it is only searching on ONE contact at a time. This is actually EXACTLY what you want for your search! So this is great news so far!
But after the search, the aggregator module (#27) only has one record to aggregate, because the iterator module is still taking priority over the rest of the scenario. The iterator module is still pushing only that ONE CONTACT through the rest of the scenario. So the iterator module is overriding the aggregator module, and you’re only aggregating one contact at a time instead of aggregating 6 contacts together.
You can tell that this is a problem because the array aggregator is outputting 6 different outputs instead of 1 output, which is what you really want.
So, by the time you get to the final “Update A Record” module (#5), you only have one Contact ID that you can update your record with. You have 6 Contact ID’s, but they’re coming through at 6 different times because of the iterator module.
You can see that the “update” module is giving you 6 outputs instead of 1 output, so it’s updating Airtable 6 different times. Each time it is updating Airtable, it is overriding the previous contact ID with the newest contact ID.
If you look at your activity history in Airtable, you will see that all 6 contact IDs came into Airtable, but each one overrides the previous one, because they each came into Airtable one-at-a-time.
There might be more than one way of solving this problem, but the way that I solve this problem is by splitting the scenario into multiple paths:
- In the 1st path, I create a variable that is an empty array.
- In the 2nd path, I iterate through the contacts, and I keep adding each contact into the pre-existing array variable.
- In the 3rd path, I send the final array variable to Airtable.
So what happens here is that only the 2nd path will run multiple times (because of the iterator). Both the 1st and the 3rd path will run ONLY ONCE, which will give you the results that you’re looking for.
You can see screenshots of this in the messages below. (Discourse only lets us upload 5 screenshots per message, so there are 2 messages below.)
p.s. In my scenario, I’m creating a new record in Airtable… so your scenario will be slightly different than mine, since you’re updating an existing record.