Skip to main content

Office 365: Email Message Input

Description

This step retrieves emails from a Microsoft 365 mailbox based on filter criteria. You specify the mailbox, folder, and filter conditions. This is a row-generating step that returns matching emails for processing by subsequent steps. Use this step in workflows that poll for new emails, process incoming messages, or collect email data for reporting.

Note:

  • For MFA enabled user account. Select Grant Type as Refresh Token.
  • If the emails need to be marked as read, then you need to provide the ‘Mail.ReadWrite’ permission.

Permission:

  • Office 365 Email Messages Input Step needs the following permissions to fetch emails.

    Permission typePermission (from least to most privileged)
    DelegatedMail.ReadBasic, Mail.Read
    Delegatedoffline_access
  • To access a shared mailbox, verify the following configurations are complete:

    • Provide admin consent for the corresponding delegated *.Shared Microsoft Graph permissions
      Mailbox permission on the shared mailboxDelegated Graph permission (app registration)
      Full AccessMail.Read.Shared

Configurations

No.Field NameDescription
1Step NameName of the step. This name has to be unique in a single workflow.
Connection:For details about app registration, see Office 365 App Registration for Grant Type – Password Grant or Office 365 App Registration for Grant Type Refresh Token
2Grant TypeSelect the type of grant from Password Grant or Refresh Token.
The data type is string. This field is mandatory.
Note: It is recommended to select the grant type from Refresh Token.
3Tenant IDTenant ID of Microsoft Account.
The data type is string. This field is mandatory.
4Client IDClient ID of the Application created in Microsoft Account.
The data type is string. This field is mandatory.
Client Secret:
5Accept Value as variable/staticLeave checkbox unchecked to accept Client Secret value from a field in the previous steps of the stream using a drop down list. Else enable checkbox for Client Secret field to appear as Text box.
6Client SecretSpecify the Client Secret generated in Microsoft Account.
Client Secret is entered using a widget. The widget handles both Text (static value or environment variable) and Combo (drop down containing values from previous steps). If checkbox above is enabled Client Secret field appears as a Text box and accepts static or variable values. Else if checkbox above is disabled Client Secret field appears as a drop down to select fields from previous steps.
The data type is secure string. This field is mandatory.
7UsernameSpecify the name of the user whose email attachments are to be downloaded.
8PasswordSpecify the password for the provided user name.
9Refresh TokenSpecify the refresh token required to authenticate the details.
10Button: Test ConnectionTest connection with Client ID and Client Secret provided. Verifies whether the connection is established or not.
Note: For the purpose of verification fields coming from previous steps are not allowed since field values can only be accessed when workflow is in running state. Static values and environment variables are allowed.
General Tab:
Input Fields:
1Shared Mailbox EmailSpecify a shared mailbox address to Reads inbox emails from the shared mailbox.
Leave the field blank to read email for the currently authenticated account.
Note: The authenticated account must have access permissions for the shared mailbox, else the step fails and returns a Microsoft Graph permission error.
The field accepts variable/static values
2FolderSpecify the folder of which emails are to be fetched. Provide folder name, such as, folder1/folder2/folder3…folder.
The data type is String. This field is mandatory.
Note: It must be a valid email folder and the folder name must not contain slash(/).
3GetClick to display a list of folders for email account.
Known issue: The folder structure may not be correct when fetched and selected through Get.
Note: Verify the folder structure when selected through Get.
Recommendation: For multi-level folder structure, pass the folder structure directly to the field instead of selecting through Folder Explorer, which appears after you click Get.
4RetrieveSelect from the following retrieve options:
- Get All Messages
- Get unread messages.
5Retrieve The Top ... EmailsProvide the positive integer value to fetch top n emails.
This field is optional.
Retrieve The Top ... Emails value is ignored if ‘Fetch in Batches’ below is ‘Yes’.
6Retrieve Emails In Reverse OrderAllowed values: 'Yes', 'No'. Provide ‘Yes’ to fetch in reverse order i.e. Old to New. This field is optional.
7Mark As ReadAllowed values: 'Yes', 'No'. Provide ‘Yes’ if fetched mails are to be marked as read. This field is optional.
8Default CharacterLimit For Test Extraction Specify the character limit to read the email body.
Default value: 1000000
Batch:
1Fetch in BatchesAllowed values: 'Yes', 'No'. Provide ‘Yes’ to fetch in batches.
Note:
• If Retrieve Emails In Reverse Order and Fetch In Batches both are selected then the batches are reversed.
• Retrieve The Top ... Emails value is ignored if ‘Fetch in Batches’ below is ‘Yes’.
• Batch Size and Limit will be considered only if Fetch in Batches is ‘Yes’.
2Batch SizeThis field is enabled if the checkbox above is selected.
Provide the positive integer value for the size of the batch to be fetched.
If ‘Yes’ is provided in ‘Fetch in Batches’ field above, a value must be provided.
3LimitProvide a positive integer which is an upper limit for the total number of emails to fetch.
You may optionally provide a value if Yes is provided in field ‘Fetch in Batches above.
**Filters Tab: **
Header:Note: If multiple filters are used from the below list, then AND operator is used for filters.
The data type of all fields in the Header is String. The fields are optional.
1SenderProvide the mail address to filter mails by Sender.
2RecipientProvide the mail address to filter mails by Recipient
3SubjectProvide the value to filter mails by Subject.
4CategoryProvide the value to filter mails by Category.
5Has AttachmentsProvide the value to filter the emails with attachments. Allowed value: ‘True’ or ‘False’.
6Search TextProvide the value to search the text in either of Body, Sender, or Subject.
Received date:
7ConditionSelect the condition to filter mail by received date.
Allowed values are: 'None', 'Equal to', 'Smaller than', 'Greater than', 'Between...and...'.
Date values below are not considered if Condition is ‘None’/Blank.
8Date1Provide the Date1 (yyyy-MM-dd) for the provided condition.
9Date2Provide the Date2 (yyyy-MM-dd) only if Between conditions is selected.
Note:
- Validate Date1 and Date2 based on the selected condition for Received Date.
- Date values below are not considered if Condition is ‘None’/Blank.
- Date1 value must be smaller than Date 2 value if Received Condition is 'Between...and...'; and if Date1 value is greater than Date 2 value then the workflow executes successfully without any output.
Advanced FilterNote:
• Selecting Use Advanced Filter disables Header and Received Date group fields.
• Advanced Filter bypasses the ~270-email limit and supports @odata.nextLink pagination.
• Selecting Get unread messages from the Retrieve field automatically adds the isRead eq false condition to the existing filter expression.
Important:
• Clear the Use Advanced Filter checkbox and use standard search fields to:
o Find To/CC/BCC recipients.
o Perform email body searches.
o Evaluate properties using the endswith operator.
• Do not combine $orderby with startswith subject queries. Use Reverse Order to sort results from General tab.
• For shared mailboxes, use the Shared Mailbox Email field instead of a recipient filter.
• The step fails if the Filter expression or its variables resolve to empty.
• Date evaluations require full ISO-8601 formatting with a time zone (for example, 2026-05-01T00:00:00Z).
Reference:
• Microsoft Graph $filter documentation: Use the $filter query parameter to filter a collection of objects
• Microsoft Graph messages resource: message resource type - Microsoft Graph v1.0, Microsoft Learn
1Use Advanced FilterSelect the checkbox to define a single, custom search query instead of using the standard filter fields (Sender, Subject, Date, etc.). The step fetches only the messages that match the exact filter string.
2FilterSpecify a Microsoft Graph filter expression to find specific emails. The advanced filter bypasses the standard email limit and returns all matching results.

The field supports operators, such as eq, startswith, contains, ge, le, and, or, not, and to evaluate properties such as subject, from/emailAddress/address, hasAttachments, and receivedDateTime.

Note: The field is available only when the Use Advanced Filter checkbox is selected

Example:

from/emailAddress/address eq 'abc@xyz.com'
startswith(subject,'Report')
from/emailAddress/address eq 'abc@xyz.com' and startswith(subject,'Report')
hasAttachments eq true and isRead eq false
receivedDateTime ge 2026-05-01T00:00:00Z and receivedDateTime le 2026-05-31T23:59:59Z
Output Fields:This is a tabular list.
1Field NameClick on a field in the Name column to open the Select Fields Name pop-up window explorer and select email properties to fetch You may select multiple properties.
The data type is String. At least one field must be selected.
2Output Field NameSpecify an Output Field Name to hold the corresponding value of the Field Name selected above.
The data type is String. This field is mandatory.
3Keep HTML Tags in the BodySelect the checkbox if you want the HTML tags to be displayed for the mail body.
Note: The checkbox is clear by default.