Skip to main content

I have tried changing the formatting, I did a text formatter step to eliminate white space, I inspected the labels in Gmail and copied the formatting straight out of there. I can not find why this error will not go away.

 

How do I add a label to an email and gmail? What am I missing here?

Match the label’s casing exactly (e.g., 6Newsletters vs. 6newsletters). Gmail’s UI is case-insensitive, but the API may require precise casing.

or

Create a test label (e.g., TestLabel) in Gmail and update your Zap to use it. If it works, the issue is specific to 6Newsletters.


Thanks for the Tip. I tried the test label, and copied it straight from gmail when I created it. The formatter is taking out white space, and I am still getting the error.


 

Could it be something with the message ID?


Hi ​@ajones,

 

Welcome to the Community.

 

If you're having trouble adding a label to an email in Gmail through Zapier, the error usually means the label doesn't exist or there's a formatting issue. Ensure the label "6Newsletter" exists exactly as it appears in Gmail, paying attention to case sensitivity and avoiding extra spaces. If the label is nested, include the parent label in the name, separated by slashes. Lastly, try disconnecting and reconnecting your Gmail account in Zapier to refresh the connection.

 

Let us know if you have any further questions. Looking forward to your response.
 


I am having the same issue. It works when Label is Static but when it is Custom is does not work...:

Custom:

Static (works)



Label in Gmail:
 


 


Hi ​@saranobrega,

 

We apologize if you are experiencing issues with your Zap. Can you please double-check if the label has any extra spaces on it and reconnect your Gmail account for a fresh connection? 


  • Same issue…..

    Add label to Email expects an ID (and not the label name actually)

    It works in one case only: when the label does not already exist in your mail box. Therefore, the Create label step does work and returns the correct label id that you can use in Add label to Email.

    If the label does already exist, Create label falls in error (which is normal) but does not return anything. Hence no id provided.

    In any case you want to use the label name, Add label to Email step does not understand it. 

    Looking at the other comments above, this is why
    1 - everything works perfectly with static input (ID is correctly picked)
    2- any kind of manipulation of the label name (remove special characters; remove space; remove accent) does not play any role there: only the label id matters ! 

    3 suggestions
  • add some kind of FIND LABEL in zapier (input: label name; output: label id)
  • or, modify Create label, so that the id of the existing label is retuned as output (since it does exist already)
  • or, modify Add label to Email, so that it accepts label name as input

 


Hey ​@ajones!

As ​@abarbotin mentioned, the Add Label to Email action expects a label ID, rather than a label name. When you select a label from the dropdown, Zapier is sending the label ID to Gmail behind the scenes, so this works as expected. When you manually add in a label name, however, Gmail fails because it doesn’t have the label ID.

If you know the list of labels you’d like to use for this Zap, you can use Zapier’s built-in Lookup Table to create a mapping between label name and label ID, then pass the correct label ID to the Add Label to Email action. If you would like to use the same table across multiple zaps, you can instead build a lookup table within a Zapier table. Finally, you can use the Create Label action and then map the created label ID for any new labels you’d like to add via this process.


Hi ​@ajones,
 
We just wanted to see how everything is going with your Zap. Feel free to reach out if you need further assistance with your Zap. We're glad to address any concerns and assist you.
 
We're looking forward to your response.