Multiple Airtable Rows to one single email

Dear community,

I’ve read some threads, but as I am new to Make, I still cannot figure out my mistake.

I think this is a very close case to my scenario:

I have an airtable form, in which people can pick many coworks they want to book an open day. Once the form is submitted, I want to send automatic emails to coworking managers to say they got a booking.

I’ve managed to do that successfully, but my issue now is that, one person can manage multiple coworkings, and instead of getting 8 emails, I want them to get 1 email with the sum of all the coworkings that were requested.

This is my flow:

So on Airtable, I have two tables, one for bookings, and another one with the coworking owners.

The first node search for new bookings using id as unique identifier.

Then as I have coworking places in Lisbon and Oporto, I’ve routed to two different paths (as they are different questions on my form)

Then, I iterate on each question using the formula "{Coworking Space} = “{{3.value}}” / {Coworking Space} = “{{4.value}}”.

I’ve tried an array aggregator before, but it hasn’t worked out. I’ve read many threads to use the text iterator, but there is where I struggle.

I’ve tried the airtable search records, and many formulas, including the previous one "{Coworking Space} = “{{4.value}}”, but then later I don’t get the fields on gmail (email and aggregated coworks)

Any idea how I can fix it?

Thank you so much in advance

blueprint.json (66.8 KB)

Hey Fernando,

can you share your input and output bundles as well? Best guess - you are not aggregating the correct module, but I cant say for certain without checking what exactly is being iterated first.

Hi @Stoyan_Vatov , thank you for your reply, here is the input / output for one of the paths with the array aggregator (don’t have with the text one as I couldn’t get it working). Please let me know if you need information from anywhere earlier

array aggregator operation 1 input and output

[
    {
        "Name": "Joao",
        "Email": "x@gmail.com",
        "Coworking Space": "testing1"
    }
]
[
    {
        "__IMTKEY__": "x@gmail.com",
        "array": [
            {
                "Name": "Joao",
                "Email": "x@gmail.com",
                "Coworking Space": "testing1"
            }
        ]
    }
]

array aggregator operation 2

[
    {
        "Name": "Pedro",
        "Email": "x@gmail.com",
        "Coworking Space": "testing2"
    }
]
[
    {
        "__IMTKEY__": "x@gmail.com",
        "array": [
            {
                "Name": "Pedro",
                "Email": "x@gmail.com",
                "Coworking Space": "testing2"
            }
        ]
    }
]

gmail send email input/output operation 1

[
    {
        "cc": [],
        "to": [
            "x@gmail.com"
        ],
        "bcc": [],
        "from": null,
        "html": "Hello,\n<br>\nA new booking has been made for the following coworking spaces under your management:\n<br>\ntesting1<br>\n- Name: testing<br>\n- Email: y@gmail.com<br>\n- Email: +xxxxxxxx<br>\n<br>\nBest regards.",
        "subject": "New Booking Alert for testing1",
        "attachments": []
    }
]
[
    {
        "messageId": "24822517-9c0b-5079-2312-d3d674b86354@hasuhu.community"
    }
]

gmail send email input/output operation 2

[
    {
        "cc": [],
        "to": [
            "x@gmail.com"
        ],
        "bcc": [],
        "from": null,
        "html": "Hello,\n<br>\nA new booking has been made for the following coworking spaces under your management:\n<br>\ntesting2<br>\n- Name: testing<br>\n- Email: y@gmail.com<br>\n- Email: +xxxxxxxxx<br>\n<br>\nBest regards.",
        "subject": "New Booking Alert for testing2",
        "attachments": []
    }
]


[
    {
        "messageId": "eda1c6e6-4e7b-ee95-1191-a470e256c454@hasuhu.community"
    }
]

Welcome to the Make community!

Setting the Correct Aggregator Source

You need to set the “Source Module” field of the aggregator to where the bundles are coming from. This is usually an Iterator module, but can also be a search/list/repeater module.

For more information, please refer to the Make Academy.

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:

Mapping a Specific Structure Into a Complex Field

The Array Aggregator module is very powerful because it allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.

This is done using the “Target structure type” field in an Array Aggregator module.

Here is an example:

As you can see, the “Map” toggle on complex fields are used when you have an array. You can easily build an array variable to map to a future module’s field, by using an Array Aggregator module and select the “Target Structure Type” as the future module’s field you have mapped the array into.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.