Gmail: Attachement Filter

hey folks,

My scenario:

Gmail:Watch Emails → Filter specific Emails → Gmail: Send an Email

(Subject/Content/Email Adress removed for the screenshot)

My questions related to the attachements:

When an email with an attachment (PDF) triggers my “Watch Emails” module and I send the subject, content, and attachment to another address, the module always picks the first attachment, which is a PNG. How can I ensure that only the PDF from all the attachments is sent?

Cheers

1 Like

You need to use the “Iterate Attachments” module, and then a filter to check the file extension or mime type to only allow PDFs through. Finally, use an Array Aggregator to map the array of attachments back into the attachments field.

Aggregators

Every result (item/record) from 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.

There are other types of aggregator modules, click the below links to find out more:

Array Aggregator – mapping multiple bundles 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” of 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.

2 Likes

okay it works so far :slight_smile:

Just one more questions:

When i set up a filter and i want to filter certain emails, so in my case:

When i “watch emails” and 10 different emails are coming in. And i want to filter 1 specific email that i want to get filtered out - so its NOT going through. How do i achieve this?

this email is still passing the filter, why?

“Not equal to” doesnt work aswell. It always passes the filter :confused:

cheers :slight_smile:

No problem, glad I could help!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

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.