Hi, I’m building a scenario that checks table availability for a restaurant. A webhook provides three inputs:
- Date of the reservation
- Time of the reservation
- Number of diners
The goal is to determine whether there is at least one table free that meets the requested capacity, or if all tables are already booked.
Current Flow
- Search Records: Retrieve all tables whose
{Capacity} >= Number of diners
.
- Iterator: Loop over each table returned.
- Search Records (per table): For the current table, check if a reservation already exists at the given date & time.
- Boolean Flag: I declared a variable
reservationFound = false
before the iterator, and inside the loop I set it to true
the first time I detect an existing reservation. This is meant to prevent creating duplicate bookings in Airtable.
What I Want
Once the iterator has processed all tables, I want a Router that:
- If
reservationFound
is still false
→ all tables are occupied at that slot, so respond “No availability.”
- Otherwise → at least one table is free.
The Problem
The Router condition fires inside the iteration, so it evaluates on each table rather than after the entire loop finishes. As a result, I can’t reliably tell if all tables were checked and found occupied. The Router branch that checks reservationFound == false
runs for each iteration instead of once at the end.
Has anyone run into this? How can I run a Router (or equivalent logic) only after the iterator completes? Any advice on best practices for “post-iteration” branching in Make would be greatly appreciated!
Thank you in advance!
1 Like
Welcome to the Make community!
To “close off” the iteration “loop”, you simply need to use an aggregator.
When you are using a search or list module, you should be immediately aggregating it into an Array.
Combining Bundles Using Aggregators
Every result (item/record) from trigger/iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.
Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.
You can find out more about the other types of aggregator modules here:
Question: Which is the best aggregator do you think you’ll need for your use-case?
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
Hi Samliew,
I’m familiar with aggregators, but I’m not sure whether they are applicable in my case.
My goal is to perform a full iteration X times, and only after completing all iterations, evaluate a flag to determine whether it is still set to 'false'
. If it is, that would mean there is no availability in the restaurant.
In the main path of the scenario, there’s a filter between the router (24) and the Airtable module (11). This filter checks two conditions: whether the flag is 'false'
and whether the total number of bundles returned by Airtable module (7) is equal to zero.
This means that if a table is available, the total number of bundles for that iteration will be zero, and the flag will be 'false'
only during the first iteration (I later update it to 'true'
to ensure that only one booking is registered).
On the other hand, if no table is available, Airtable module (7) will return one or more bundles (indicating a match), and the scenario will not proceed through the main path—it will stop at the router (24).
Given this logic, I’m unsure where or how to place the aggregator effectively within the scenario.
1 Like
Hi @FlipiFlopi ,
You can search the record using the specified filter. Add a condition to check if the ID exists and include a date comparison in the filters to verify its presence. If the ID exists, aggregate the data and use it to respond that the slot is not available. Additionally, you can set up fallback filters to reply that a slot is available if no match is found.
Feel free to share your scenario blueprint so we can better understand it and provide you with a more effective solution
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation
1 Like