Best answer

The "Remove Label from Email" action in Gmail is not working as expected.

  • 22 August 2023
  • 14 replies
  • 249 views

Hey all,

I’m not new to Zapier, but I’m hitting a wall on the below..

I have looked through the forum, and am still having trouble identifying why my “Remove Gmail Labels” step isn’t working. The workflow is:

  1. An email string contains the text “#_RELEASED”
  2. Find email string (which may or may not be necessary)
  3. Add label: “#_RELEASED”
  4. Remove label: #_ACH and #_SUBMITTED

Using the email ID found in step 2, Step 3 works. Step 4, however, says it works, but doesn’t actually remove the #_ACH or #_SUBMITTED labels. 

 

Things I have tried:

  1. Using the message Thread
  2. Using the message ID
  3. Using the regular ID
  4. Isolating one label to remove
  5. Skipping the “find email string” step all together and working off original email (which is the intent)

Nothing has worked…

Thank you

Max

icon

Best answer by Troy Tessalone 24 August 2023, 23:06

View original

14 replies

Userlevel 7
Badge +14

Hi @mw998 

Good question.

Please post detailed screenshots with how your Zap steps are configured to help give us context.

Here you go. I have since removed the Find Email String step, as it seemed superfluous. 

 

 

Userlevel 7
Badge +14

@mw998 

In the DATA OUT from Zap Step 1, does the Label IDs contain these Labels? (screenshot)

  • #_SUBMITTED
  • #_ACH

 

EXAMPLE

 

Great question! It doesn’t seem to:

It just shows the #_RELEASED label (the other label is something else).

 

Why would that be?

 

Thank you for your prompt replies. 

Userlevel 7
Badge +14

@mw998 

Gmail Labels can have internal IDs.

Check the Labels dropdown to see the options.

Each option has 2 values.

The top value is the friendly label.

The bottom smaller value is the internal value that the field expects and is used in the code.

Do the Label_XXX values match to the friendly Labels of #_SUBMITTED and #_ACH?

 

 

I checked, and the label numbers for #_ACH and #_SUBMITTED are called out correctly

 

 

Userlevel 7
Badge +14

@mw998 

Can you show an example of a Zap Run with the DATA OUT from the Gmail trigger that shows both these Label IDs?

Also wondering if the Zap won’t work as expected if only 1 of the 2 Label IDs is present instead of both.

 

To simplify the testing, I took out the “#_SUBMITTED” label, so it should only remove the “#_ACH” now. 

 

The data out is below. Strangely, it says “Sent 1 new label to gmail” instead of “Remove label.”

 

 

Userlevel 7
Badge +14

@mw998 

Can you show screenshots with the DATA OUT for each step related to the returned Label IDs?

 

 

Userlevel 7
Badge +14

@mw998 

In this Zap Run.

Step 1 DATA OUT had 1 Label: DRAFT

Step 2 DATA OUT had 2 Labels, because 1 Label was added.

Step 3 DATA OUT had 2 Labels, because the Label(s) to remove were part of the list of Labels.

 

 

Userlevel 7
Badge +14

@mw998 

You probably want to adjust your Zap Step 1 Search String.

Make sure to review the field description and click the [more] link: https://support.google.com/mail/answer/7190?hl=en

 

 

That worked!!!!

Userlevel 7
Badge +11

Thanks so much for confirming that adjusting the search string for the trigger step worked, @mw998! So glad Troy was able to help you solve things here. 🎉

Seems like you’re good to go right now, but please do reach out again in the Community if you run into any further issues or questions. The Community is always here and eager to help! 😁

Reply