Filtering from a Google Sheet

Hi,
I am about to dope my gmail with AI functions. In the first steps of scenario, i would like to do a filter that only goes forward if the “sender email” or the “subject” does not contains certain words (or complet email). And the subject is i would like add theses mails / words in a google sheet (one per line, on A column)

My problem is:
1- when i add the google sheet module, the scenario multiplies the output bundles (one per line) to treat
2- i cannot success to have a filter that match both values : email OR Subject

GG



Is there someone who could explain me where i’m wrong ?

  1. With Google sheets the search module will spit out bundles. If you want an array you need to use some sort of aggregator.
  2. The filter isn’t working because it’s filtering against all the outputs in your first step against each and every output in your second step.

Make the Google sheet your first step and use the map() function to filter the emails with the text strings in the Google sheets. This way your results aren’t multiplied

Thank you :slight_smile:
I’ll try that tomorrow !

Erf,
It seems Gmail “watch for email” function MUST be the trigger: i can’t link it from the GSheet module :unamused:

Welcome to the Make community!

Yes, you’ll have to put the sheets module second. Trigger modules can only be placed at the start.

1 Like

Opps sorry missed that. Try using a mailhook instead and make that the first module. With a mailhook each individual email will come in as a single bundle.

But if you want to keep the watch gmail module you will have run through the google sheet module each time, which is kind of a waste of operations since those values do not change.

Other option is to get rid of the google sheets module and instead use the inline function contains() and hard code each of those options.

Hope this helps!

Thank you Sam!
If you think of a track to follow to solve my quest… i’m full ears on :smiling_face::sweat_smile:

Sure, this is quite simple actually.

The main issue you are facing is the range/row “results” from the Sheets are returned in multiple bundles.

You’ll want to “combine” them into a single array so you can create a pattern to “test” the email text content, in a filter.

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.

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

@samliew

No pb LinkYourTech.
I do want to keep the gmail module.

I was thinking on using an agregator + array “contains” in the filter.
like :

But now i block in the filter: i don’t know how to precise the “contains” action must search “inside” each pipe.

If you want to filter out spam, I suggest this method instead: [Free Module] Use Groq AI to filter spam emails and form submissions!

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

@samliew

Hello Sam.
I tried taht too, but as i didn’t master the “join” operator, i stopped searching that way.

As you can see, i started an other : use a formula un gSheet first to have the value already from th sheet :slight_smile:
formula

So now i can i have all in one string and one bundle

But now i search again the right operator to power the filter :thinking:
this one does not work

An idea ?

you want a Text Pattern, not a Text Contains operation.

and you have to wrap your pattern with another set of brackets.

and you cannot put spaces between your pipe.

see my example screenshot above.

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

@samliew

hi Sam, thank alot for trying to help me.

i’m near to succes i think :sweat_smile:

and

but i have that now :slight_smile:

that gives

and the filter like :

but i have that error now

Sorry to bother you. it’s a little hard to understand. but i try hard ! :sweat_smile:

Now instead of combining the cells in Make, you are doing it in Sheets.

So you no longer need to do the map-join functions in the filter, just map the output value from “Get a Cell” in the bottom half of the filter.

({{24.value}})

Then your filter still needs to use the Text Pattern operation, not Text Contains.

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

@samliew

2 Likes

Hurrraaay !
Thank you Sam!

I think it works now :slight_smile:

gives now

with bundle 1 like


(the value is “no-reply|DDM|BEAUTY” :ok_hand:)

and bundle 2 like

As you can see, i also do a filter on the subjects now!

Thanks a lot and have a nice day!
Lionel

PS : and i have understood, what “pattern” means: it has nothing with the | it juste verifies if in the string there is a chain of caracters that “matches” the other chain of caracters

1 Like

I had the same issue and it worked just fine. Match patterns is really powerful when filtering. I would love to know more about how it works in general!

For more information on regular expression patterns, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

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

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

1 Like