Email fields

The fields an email carries – sender, subject, body and more – for each kind of email, which bot version each needs, and how to read them in a trigger filter, a loop or a condition.

Help CentreBuilding Processes

An email's fields depend on where it came from. An Outlook find result, an unread email in a loop, an IMAP/POP3 message and an Outlook thread each carry a different set. This page lists each set, says which bot version you need, and shows how to write the fields.

The rules below about missing fields apply to trigger filters and loop filters. An if-step (Decision) keeps the old comparison: a field that does not exist there is read as the text #VAR!.

1. How to write a field

  • In a New email trigger filter, use the field name on its own: {sender}. This works from bot 6.6.4.
  • In a loop over emails, put the loop variable first. If you named the loop variable email, write {email::sender}. Inside the loop, the short form {sender} also works.
  • After a Find step, the variable holds a list of emails, so pick one first, for example {emails::0::sender}.
  • A name with a space is written as it is, with no quotes: {email::auto response}.
  • Compare a field, not the whole email. {email} = x never matches, because {email} holds every field at once. Write {email::sender} instead.
  • What a filter can read. A trigger filter reads only the email's own fields and the clock, such as {now::time}. It cannot read Assets or process variables, because it runs before the process starts. Loop filters and if-steps can read Assets.
  • In a "Matches regex" value, braces are read as a variable: {3} in ^INV\d{3}$ becomes empty. Write ^INV\d\d\d$ instead.
Bot version:
  • Unread email loopsender, sender_name, has_attachments and total_attachments all need bot 6.6.8 or later.
  • Outlook find resultshas_attachments and total_attachments work on every version. Only sender and sender_name need bot 6.6.8 or later.
  • On an older bot, use {email::from::email} for the address and {email::from::name} for the name (after a Find step, {emails::0::from::email}).
Important: use the exact field name, with the same capital letters. What happens when a filter names a field that does not exist depends on the bot:
  • Older than 6.6.8 – with a "not" operator (!=, does not contain, does not start with, …) every item gets through. With = or another positive operator, nothing gets through.
  • 6.6.8 or later – the row fails either way, and the bot logs the fields the email does have.
  • Is empty and Is not empty still answer on every version: a missing field counts as empty.

2. Email (Outlook find, and the New email trigger)

Each email from OUTLOOK Find an e-mail, and the email that fires a New email trigger. Outlook only.

senderThe sender's email address. Use this one to check who an email is from.
sender_nameThe sender's display name, e.g. Jane Smith
subjectThe subject line
bodyThe message text
has_attachmentsWhether the email has attachments (true or false). On an Outlook find result this works on every bot version.
total_attachmentsHow many attachments it has. On an Outlook find result this works on every bot version.
toThe To addresses, as a list
ccThe Cc addresses, as a list
timestampWhen it was sent, YYYY-MM-DD HH:MM
unreadWhether it is still unread (true or false)
idOutlook's own id for the email
messageIdThe internet message id
fromThe sender, with two parts: {from::name} and {from::email}. Kept so older processes keep working; use sender on bot 6.6.8 or later.

3. Unread email (loops and single Outlook emails)

Each email in Loop through unread emails, and the email from the Outlook steps that fetch one email: get an email by id, wait for an email, and select an email. Outlook only. It has every field in section 2, plus the ones below. In the loop, sender, sender_name, has_attachments and total_attachments need bot 6.6.8 or later.

attachmentsThe attachment files the step saved, as a list of full paths
auto responseWhether the email is an automatic reply, such as an out-of-office (true or false). Write {email::auto response}.
total attachmentsThe old spelling of total_attachments, kept for older processes

4. IMAP and POP3 email

A full message read from an IMAP or POP3 mailbox. List and search results carry only some of these fields.

senderThe sender's email address
sender_nameThe sender's display name
subjectThe subject line
fromThe raw sender text from the email header, e.g. Jane Smith <jane@example.com>. It has no parts; use sender for the address.
toThe To addresses
ccThe Cc addresses
dateWhen it was sent (IMAP has no timestamp)
message_idThe internet message id
bodyThe message text
htmlThe message as HTML
attachmentsThe attachments

5. Outlook thread email

Each email in the result of the Outlook step that reads a conversation thread. Outlook only.

senderThe sender's email address
sender_nameThe sender's display name
subjectThe subject line
timestampWhen it was sent, YYYY-MM-DD HH:MM
idOutlook's own id for the email

6. Example: skip emails from one sender

To start a process for every new email except those from your manager, add this filter to the New email trigger:

Filter{sender}
Operator!= (does not equal)
Valueboss@example.com

In a loop over unread emails with the loop variable email, the same filter is {email::sender} != boss@example.com on bot 6.6.8 or later. On an older bot, write {email::from::email} != boss@example.com.

A common mistake is {email::from} or {email::sender name}: the first holds a name and an address together, so it never equals an address, and the second is not a field.

7. Fields for other triggers

  • File added / changed / removed / renamed – the file fields, such as {name}, {extension} and {path}. See Loop variables for the full list.
  • Folder added / changed / removed / renamed – the folder fields, such as {name} and {path}.
  • Queue item availableid, reference, priority, status, specificContent (the item's own data, e.g. {specificContent::invoice number}), deferDate, dueDate, retryNumber and createdAt.
  • Schedule and Every few seconds – no item fields.

Every trigger can also read the current time, for example {now::time} or {now::date}. See Built-in variables.

Related articles

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.