Using Microsoft 365 Outlook trigger in Trigger loop: Handle

You can use the email trigger to start a bot when your receive an email after connecting to the Microsoft 365 Outlook server using the OAuth 2.0 authentication.

Prerequisites

Ensure that in Automation Workspace, you have used the Trigger loop package to add the Trigger loop to your bot.

Procedure

  1. In the Trigger loop, select Trigger loop: Handle.
  2. Click the Trigger on drop-down menu and select Microsoft 365 Outlook Trigger > Email.
  3. Click the Azure Cloud drop-down menu and select one of the following options:
    • Azure Global: For the Microsoft 365 Commercial version (login.microsoftonline.com)
    • Azure GCC High: For the Microsoft 365 Government version (login.microsoftonline.us)
  4. Use the Check every field to specify or set the trigger interval time.
    The trigger interval for the bot is set to 120 minutes by default.

    (Optional) Click the Minutes drop-down menu to change the value to Seconds.

  5. Click the Authentication mode drop-down menu and select Client Credentials.
    For more information on setting up OAuth 2.0 to use client credentials, see Set up OAuth 2.0 using client credentials.
  6. For the Client ID, Tenant ID, Username and Client Secret fields, select one of the following tabs:
    • Credential: Click Pick to select a value from the credential vault.
    • Variable: Specify a variable.
    • Insecure String: Enter a value or click the Insert a value icon to select an existing variable.
  7. (Optional) Use the Select Conditions field to select any or all of the following options for email events from the selected server type:
    • Email from: Enter the email addresses or click the Insert a value icon to select an existing variable.
    • Email subject contains: Enter a condition for the email subject line.

      For example, you can enter 'Sales report' as a condition to trigger a bot when you receive any email that contains the subject line as 'Sales report'. You can also click the Insert a value icon to select an existing variable.

    • Email attachment: Select one of the following email attachment options:
      • With attachment
      • Without attachment
    • Email in folder: Enter the filepath of the email folder.

      For example, if you want to trigger a bot when you receive an email in Microsoft 365 Outlook folder called 'Sales', enter inbox/sales. You can also click the Insert a value icon to select an existing variable.

  8. Use the Assigned to (optional) field to select one of the following tabs:
    • Multiple variables: Click Add variable mapping to associate a key with a variable.
    • Record: Use the Assigned to drop-down menu to assign an existing variable or click the Create variable icon to create a variable that you want to assign.
      Note: You can use this variable to retrieve various details about the email that triggered the bot, such as sender, recipient, subject, email content, date, action information, email server host, and port data.
  9. Click Save to save your configuration.
    Microsoft 365 Outlook is now configured within the trigger loop handle of a bot.