Objective
The objective of this practice problem is for the user to demonstrate an understanding of the Outlook commands discussed in the previous sections by creating an automation that utilizes said commands. The commands covered in the previous section were the Send Outlook Email & Move/Copy Outlook Email. In the future, these commands may be implemented into other practice problems.
Scenario
An employee of the ABC company is in the process of sending themselves an email and moving said email into another folder. This employee is conducting the exercise to test the functionality of moving emails in Outlook folders.
Prerequisites
The user will ensure that the following two folders exist in their Outlook email: Inbox and Test. Please note that the Test folder must not be a sub-folder to another Outlook folder or else the automation solution will not work.
Practice Problem Requirements
The user must create an automation that performs the following tasks:
  • Sends a test email to themselves (example@test.com)
  • Pauses the scripts for 15,000 milliseconds (15 seconds) to wait for email to enter Inbox
  • Moves the unread test email into the Test folder

Problem Difficulty: Easy
Solution will be provided on the next page with a brief explanation.

Solution
The code for the solution has been provided below.
As a quick summary:

Step 1: The Send Outlook Email command must be called first to draft and send the email. Ensure that the email is being sent to the user’s email address (i.e. example@test.com)

Step 2: The Pause Script command is used in this exercise to wait for the email to exist in the inbox because OpenBots works faster than Outlook. It will look for the email before it is in the Inbox Folder, will see it’s not there, and throw an error. To be safe, pause the script for 15,000 milliseconds (15 seconds)

Step 3: The Get Outlook Emails command is used to extract the new email that was just sent to the inbox. The Filter criteria is searching based on the email’s subject (Test). Select “Yes” for the Unread Only section.

Step 4: The For Each command is used to process each of the extracted emails from the previously used Get Outlook Emails command.

Step 5: The Move/Copy Outlook Email command is used to move the email from the Inbox into the Test folder.

Newsletter Bot

Lets stay in touch!

Join our weekly newsletter and follow us on social media.

Contact Sales
Call Our Experts!