Best answer

Gmail New labeled email to only fire once

  • 30 August 2023
  • 10 replies
  • 221 views

I have a Zap that triggers when I label a new Email in Gmail with “New business”. This then posts to our #new-business Slack channel. Fairly straight forward, and this works.

 

However, it fires on every single email - e.g the client and I might be having a back and forth with 10 emails between us. This creates 10 different posts in Slack.

 

I want to fire only a single notification in slack that there is a new opportunity - to only happen when I tag the first email.

 

Do I need to setup a filter for this to work?

icon

Best answer by ken.a 30 August 2023, 14:05

View original

10 replies

Userlevel 7
Badge +14

Hi @unodw 

Good question.

Try this…

Add a Filter step that compares the Message ID to the Thread ID.

If those values are exactly the same, then it’s the first message in a thread.

 

Thanks Troy - that’s super helpful. 

 

I have tested this with a new message and saw that Thread_ID is always different, even on mails that are the first in a thread. My screenshot below is of a message like this.

There is another ID only called “ID” which seems to match the message ID

 

 

This doesn’t work unfortunately as the ID and Message_Id are always the same.

 I could not find an instance where Thread_ID and Message_ID were equal.

 

Userlevel 7
Badge +6

Hi there @unodw,

I’m jumping in to see if I can help!

We have a feature request to Prevent Replies from re-triggering New Labeled Email when original email already triggered Zap. I have added your vote to that feature request and we'll let you know once it is implemented.

As a workaround, you can add a "Filter by Zapier" step after the Gmail step. This step should be configured to "Only Continue IF" the "Email ID" is not already present. By doing so, even replies with the same ID will be caught by the filter, effectively preventing the Zap from processing any other emails sharing that ID.

Hopefully, this helps! 😊

Userlevel 7
Badge +14

@ken.a 

There is no field named Email ID.

Can you provide a screenshot example?

 

 

 

 

@ken.a yeah what @Troy Tessalone said - I also couldn’t find that field.

 

 

I think I have a solution here, but it’s cumbersome.

I can create a data table that tracks message ID’s. If the message ID Does not exist in the table, then proceed. If it does exist, then halt. Each time a new message comes in, I will create a record in the data table.

 

I think that’s sort of what you’re saying, but you were using email ID’s as the reference point. We have clients who have multiple deals under the same ID, so this won’t work for us. I think the messageID/ThreadID might be the way.

Userlevel 7
Badge +6

Hi @unodw and @Troy Tessalone,

I apologize for the confusion here.

The email ID should look like this:

d8f2a992b2720fa5d946275361cd2f62.png
(view larger)

@unodw, I also came across another workaround in our notes:

  1. Add Lookup Spreadsheet Row (or create if none is found) in Google Sheets.
  2. Add Filter: only continue if _zap_data_was_found_ exactly matches false.
  3. And use message_url as unique identifier.

Hopefully, this clears things out! 😊

Userlevel 7
Badge +14

@unodw 

Yes, using lookup tables is a valid approach:

 

Userlevel 1

I appreciate the New Labelled Email trigger firing for each back-and-forth email is not ideal for some. In my case, it is helpful. Currently, each email in a back-and-forth conversation in Gmail is copied over to our CRM and applied to the appropriate contact record. For us, the way the New Labelled Email trigger works currently is ideal. :)

If this trigger is to be updated to eliminate this ability, perhaps another Gmail trigger could be added to maintain this functionality?

Userlevel 7
Badge +6

Hi @NathanSanctuary,

Thank you for this valuable feedback. Our Developers will certainly consider this and your feedback is noted since this post is linked to the feature request.

Hopefully, this helps!

 

Reply