Skip to main content
hasLabel resolves an existing Gmail label and reports whether it is currently applied to one message. Use it to route mail based on a user label or a Gmail system label.

Example

Archive new messages that already carry the Handled label:

Inputs

Every input field also accepts a compatible Signal; the example passes the new-message signal into messageId. Label IDs must match exactly. Display names are matched after trimming surrounding whitespace and ignoring capitalization.

Output

The action returns a Signal<boolean>: true when the resolved label is applied to the message, and false when the label exists but is absent.
A missing label is an error, not a false result. Labels belong to a specific Gmail account, so make sure label, messageId, and account refer to the same mailbox.