Basic

Let's start by getting the robot to look for emails in our mailbox using the Basic method. The following steps describe how to create a brand new process to see how the action works:

  1. Create a new process in Blue Prism Studio named Receive Emails.
  2. In the Main page, drag and drop an Action stage and place it between the Start and End stages. Configure it as follows:
    • Name: Search for emails
    • Business Object: MS Outlook Email VBO
    • Action: Get Received Item (Basic)
  1. Take a look at the list of Inputs. None of them are mandatory. If you choose to leave all the input blank, the action will attempt to get all the mail items in your inbox. Unless you have kept your inbox really clean, chances are it will take some time before you get back the results. Usually, we will search with some criteria in mind.

    The options available in Basic mode are:
    • Subfolder: By default, the search covers the Inbox and all its subfolders. However, you can restrict the search to be within a specific subfolder by putting in its path here; for example, InboxFolder A.
    • Sender name: If you are looking for an email from someone, enter the sender's display name here, for example John Doe.
    • Sender email: To be more accurate, you may choose to enter the sender's email address instead. This will avoid any confusions with names that look the same, such as [email protected].
    • Received earliest: Gives you the option to restrict the search to retrieve all emails received no earlier than a specified date and time. For example, putting in a date of 01/01/2018 00:00 will get all emails received after January, 1st 2018.
    • Received Latest: On the flip side, this gives you the option of restricting the search to only get emails received no later than the specified date and time. For example, if the received latest date is 31/03/2018 23:59, we will get all the emails sent before 31 Mar 2018 23:59. Received Latest and Received Earliest are often used together to search within a slice of time. 
    • Subject: Search for emails with specific text in the subject field. Note that searches by subject are exact matches unless you use a wildcard. If you want to look for all messages with the word deals in the subject line, enter *deals*.
    • Message: Similar to using the subject filter, but it looks for the text in the message body instead. 
    • Include Read: Includes emails that have been marked as read in the search results. If left blank, the search will include emails that have been read.
    • Include Unread: Includes emails that have been marked as unread in the search results. If left blank, the search will include unread emails.
  1. Give it a try. Configure the action to look for the email that we just sent in the earlier part of the chapter. Apply the following search criteria:
    • Subject: We fixed the subject of the email that was sent out. To apply it back here, enter Your items have been added to the cart.
    • Received earliest: To search only for email received today, enter Today().
To limit the search to only unread mail, set the Include Unread flag to False.
  1. Switch to the Outputs tab. There are two results that are returned by the Get Receive Items (Basic) action. Click on the Data Item icon for both output to create them.
    • Items is a collection that holds the list of emails that matches the search criteria.
    • Item Count tells us how many items have been found.
  2. Close any opened dialog screens. Back on the canvas, link up the diagram as follows:

Run the process. When it completes, check the results by looking at the Items and Item Count data items. Did you manage to retrieve the email that we sent out earlier? If you open up Items and look at its Current Values, you will find the contents of the email. You can use a loop to iterate through the collection and read all the property values.

Play around with the action by setting other search criteria and see whether you are able to retrieve them from your inbox. For example, you may want to search for all emails with deals in the subject sent within the month of May, or for all emails from your favorite subscription sent in the past one year.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset