Best Practices for Outlook Activities

This section describes best practices for Outlook activities that help you design automations to perform various Outlook events such as search email, send email, delete email, save attachment, and many more.

Application

Set of activities and functions related to Microsoft Oulook application.

Activity Name Description Best Practice

Open Outlook Instance

Opens an instance of MS Outlook.

This activity is mandatory and helps to perform various Outlook events.

You must use this activity at the beginning of the workflow to use other MS Outlook activities.

Close Outlook Instance

Releases the link between the SDK package and MS Outlook and closes MS Outlook.

You must use this activity with the Open Outlook Instance activity. You cannot close the existing Oulook instance using this activity alone.

Release Outlook Instance

Releases the link between the SDK package and Outlook, but Outlook remains open.

Always use the Release Outlook Instance activity or Close Outlook Instance activity at the end of a workflow.

Email

Set of activities and functions related to Email.

Send Emails on Behalf of Someone in Outlook

When you use onBehalfOf parameter in emailItemParameters for the Send Email (Outlook) or Create and Display Email Item (Outlook) activities, make sure that you have the right delegate permission to do it.

You must configure a delegate permission to enable User A to send emails on behalf of User B in Outlook.

  • User B must delegate access to User A

    To delegate access for User A, open Outlook. Then, navigate to Start of the navigation pathFile Next navigation step Account Settings Next navigation step Delegate AccessEnd of the navigation path. In the Delegates popup window, choose Add. In the Add User popup window, search for User A and then choose Start of the navigation pathAdd Next navigation step OKEnd of the navigation path. Delegate permissions for user A popup window is displayed. User B can set the permission values to None.

  • User A must add an additional mailbox for User B in his Outlook session

    To add an additional mailbox for User B, open Outlook. Then, navigate to Start of the navigation pathFile Next navigation step Account SettingsEnd of the navigation path. In the Account Settings popup window, choose Change. In the Change Account popup window, choose More Settings. In the Microsoft Exchange popup window, choose Start of the navigation pathAdvanced Next navigation step AdvancedEnd of the navigation path. In the Add Mailbox popup window, search for User B and choose OK.

Activity Name Description Best Practice

Fetch Emails

Retrieves emails from all Outlook mail accounts and initiates the process of fetching mails in Outlook. It allows you to manually refresh your mailbox.

This activity is especially useful to retrieve new emails from POP (Post Office Protocol) accounts because Outlook does not automatically fetch mails when it is started by an automation, unlike IMAP accounts.

To ensure that a search activity can find new emails, you must include a wait time (waitDelay in milliseconds, with a default value of 5000) to allow the asynchronous activity to finish in the background, considering the technical limitation of not being able to end the activity once all new mails are retrieved.

Search Email (Outlook)

Searches for a specific email.

You must provide email search criteria in the Search Criteria Edit data pop-up screen.

  • element

    • subject - Search email based on the email subject.

    • senderName - Search email based on the email sender name (you have received a mail from a person).

    • recipientName - Search email based on the email recipient name (you have sent a mail to a person).

    • body - Search email based on the email body content.

    • dateReceived - Search email based on the email received date. The date criteria must be in format yyyy_mm_dd format. Search email based on the email received date.

    • dateSent - Search email based on the email sent date.

    • hasAttachment - It can be used only with equals operator and the value must be 0 (has no attachment) or 1 (has attachment(s)).

    • isRead - Search email based on the email read status (whether an email has been read or not).

  • operand

    • contains - Search email based on the contains criterion such as some words matching with the subject line, .xls, .png, .cvs, .pdf, .docx, and many more.

    • equals - Search email only those which meet equals criterion (=".csv", "matching exact words of subject line" ) .

    • greaterThan - Search email based on the greaterThan email size criterion.

      For example, 2MB - Searches whose mail size is greater than or equal to 2MB.

    • lessThan - Search email based on the lessThan email size criterion.

      For example, 2MB - Searches whose mail size is less than or equal to 2MB.

  • value

    Provide the appropriate value. For example, if you are searching mail based on the subject then in the Value field you can provide the subject line.

  • folder

    Provide the name a folder that store email messages.

  • folderType

    Specifies the folder type for a specified folder.

    For example, olFolderInbox - The Inbox folder.

  • storeName

    A store is a file name that stores email messages. For example, .pst file.

sortResultBy

You can sort the email search result by email received time or email subject. The sortResultBy is an optional input parameter.

sortOrder

You can also sort the email search result by ascending (oldest first or alphabetical order) or descending (most recent first or reverse alphabetical order) order. The sortOrder is an optional input parameter.

Send Email (Outlook)

Sends an email.

You must provide the one or more Email Item Parameters such as To, CC, and BCC.

  • To – Optional value. Intended recipient email ID.

  • CC – Carbon Copy. Optional value. You can define CC recipients if you want to copy publicly.

  • BCC – Blind Carbon Copy. Optional value. You can define BCC recipients if you want to copy email privately.

  • Subject – Subject line of an email. Optional value.

  • Body – Content of an email. Optional value.

  • Attachments - Attachments to an email. Optional value.

Create and Display Email (Outlook)

Creates and displays a draft email.

The draft email will be created with the defined Email Item Parameters and displayed.

Save Attachment (Outlook)

Saves an attachment.

The destinationPath and attachmentFileName are mandatory fields.

You must specify a folder path in the destinationPath field to save an attachment.

You must specify a file name with extension of a to be saved file in the attachmentFileName field.

For example, Filename.extension (Flower.png).

Save All Attachments (Outlook)

Saves all the attachments.

The destinationPath is mandatory field.

The extensionsToKeep and extensionsToSkip are optional fields.

You must specify a folder path in the destinationPath field to save the attachments.

The two filters extensionsToKeep and extensionsToSkip are lists of extensions, separated by a “;”

You must specify the extensions to be skipped in the extensionToSkip field. For example, .png.

You must specify the extensions to be kept in the extensionToKeep field.

For example, .png.

Delete Email (Outlook)

Deletes an email from a specified location.

You must provide the appropriate email search criteria to delete required email.

Deletes the current mail in the context. To have a context, use the Search Email Activity. To select a mail in the context, use Get First Email, Get Last Email, Get Previous Email, Get Next Email

Move Email (Outlook)

Moves an email from one location to another.

You must provide the appropriate email search criteria to move required email.

You must provide the location details such as folder name or folder type in the folder (For example, Archive) or folderType (For example, olFolderToDo) field of the Move Email (Outlook) activity where the email is moved from the specified location.

To move multiple emails, follow the procedure detailed in Move Multiple Emails in Outlook.

Get Subject (Outlook)

Returns the subject of an email.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the email subject is displayed in the Output Parameters field of the Tester Data.

Set Subject (Outlook)

Sets the subject of an email.

 

Get Body (Outlook)

Returns the body of an email.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the email body content is displayed in the Output Parameters field of the Tester Data.

Set Body (Outlook)

Sets the body of an email.

 

Get Mail Recipients (Outlook)

Returns the recipient of an email.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the Recipient email ids are displayed in the Output Parameters field of the Tester Data.

Set Recipient (Outlook)

Sets the recipient of an email.

TBD

Get CC (Outlook)

Receives the CC of an email.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the cc'd email ids are displayed in the Output Parameters field of the Tester Data.

Set CC (Outlook)

Sets the CC of an email.

 

Get BCC (Outlook)

Returns the BCC of an email.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the bcc'd email ids are displayed in the Output Parameters field of the Tester Data.

Set BCC (Outlook)

Sets the BCC of an email.

 

Get Sender (Outlook)

Returns the sender of an email.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the sender's email id is displayed in the Output Parameters field of the Tester Data.

Get Sent Date (Outlook)

Returns the sent date of an email.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the sender's email id is displayed in the Output Parameters field of the Tester Data.

Check Mail Context (Outlook)

Checks if the current context of an email exists.

You must provide the appropriate search criteria in the Search Email activity.

Returns True, if the context current email exists, False if it does not.

Is Context Current Email Not Exist (Outlook)

Checks if the current context of an email does not exist.

You must provide the appropriate search criteria in the Search Email activity.

Returns True, if the context current email does not exist, False if it is.

Get Emails Number (Outlook)

Returns email count with respect to Number of Email Items in Context.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the email count is displayed in the Output Parameters field of the Tester Data.

Get First Email (Context)

Within a context, makes the first email item as the current email item.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the output is displayed in the Output Parameters field of the Tester Data.

Get Last Email (Context)

Within a context, makes the last email item as the current email item.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the output is displayed in the Output Parameters field of the Tester Data.

Get Next Email (Context)

Within a context, makes the next email item as the current email item.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the output is displayed in the Output Parameters field of the Tester Data.

Get Previous Email (Context)

Within a context, makes the previous email item as the current email item.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the output is displayed in the Output Parameters field of the Tester Data.

Get HTML Body (Outlook)

Returns the HTML body of an email.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the email HTML body content is displayed in the Output Parameters field of the Tester Data.

Save As (Outlook)

Saves the current context email as .msg.

You must specify a folder path in the filePath field to save an email as .msg.

Set Read (Outlook)

Flags the current context email as read.

 

Set Unread (Outlook)

Flags the current context email as unread.

 

Get Context Overview (Outlook)

Retrieves the context overview.

 

Get Attachments Name

Retrieves the name of attachments.

You must provide the appropriate search criteria in the Search Email activity.

After successful execution of an automation, the names of the attachements are displayed in the Output Parameters field of the Tester Data.

Calendar

Set of activities related to the Outlook calendar.

Activity Name Description Best Practice

Search Calendar Items

Search for the calendar items that match the search criteria, and fill the context with the result.

In the calendarSearchCriteria field, you must provide a list of search criteria with an account if the search is not in the default account.

Get All Calendar Items

Retrieve all the calendar items from the context.

After the Search Calendar Items activity with the appropriate search criteria, you can retrieve all the results with the Get All Calendar Items activity.

In the propertiesFilter field, you can filter the items you want to retrieve. Filtering unneeded properties can help reduce the volume of the result and improve performances.

After successful execution of an automation, the result is displayed in the Output Parameters field of the Tester Data

Check Calendar Context

Checks if the current calendar item is defined.

You can use this activity to check if you are out of the restriced search list while analyzing the context with the Get Next Calendar Item or Get Previous Calendar Item activities.

You can also use it to check if there is at least one result in the context after a search.

Returns True, if the context current calendar item exists, False if it does not.

Get Calendar Items Number (Context)

Retrieve the number of calendar items within the calendar context.

You must provide the appropriate search criteria in the Search Calendar Items activity.

After successful execution of an automation, the calendar items count is displayed in the Output Parameters field of the Tester Data.

Get Calendar Item Details

Within the calendar context, retrieve the properties of the current calendar item.

Use this activity to get properties of one single calendar item or a few number of calendar items set in a loop.

After successful execution of an automation, the output is displayed in the Output Parameters field of the Tester Data.

Get Next Calendar Item (Context)

Within a specified context, make the next calendar item as the current calendar item.

If you come out of the restricted content, the current calendar item will be undefined.

The Check Calendar Context activity will return False.

Get Previous Calendar Item (Context)

Within a specified context, make the previous calendar item as the current calendar item.

If you come out of the restricted content, the current calendar item will be undefined.

The Check Calendar Context activity will return False.

Save Calendar Item Attachment

Save the attachment of the current calendar item.

The destinationPath and attachmentFileName are mandatory fields.

You must specify a folder path in the destinationPath field to save an attachment.

You must specify a file name with extension of a to be saved file in the attachmentFileName field.

For example, Filename.extension (Item.jpg).

Save All Calendar Item Attachments

Save all attachments of the current calendar item.

The destinationPath is a mandatory field.

You must specify a folder path in the destinationPath field to save an attachment.

The extensionsToKeep and extensionsToSkip are optional fields.

The two filters extensionsToKeep and extensionsToSkip are lists of extensions, separated by a “;”

You must specify the extensions to be skipped in the extensionToSkip field. For example, .png.

You must specify the extensions to be kept in the extensionToKeep field.

For example, .png.

Respond to Calendar Item

Respond to a meeting request.

You must provide one of the three following status in the response input parameter:

  • accept

  • tentative

  • decline

Delete Calendar Item

Delete the current calendar item.

 

Application

Set of activities and functions related to Microsoft Oulook application.

Activity Name Description Best Practice

Create Folder (Outlook)

This activity checks whether a specific folder exists in Outlook. If the folder doesn’t exist, it creates a new folder.

You must specify a folder path in the folder field to create a folder. This field specifies the full path of the folder to create from the root specified by the folderType field in the specified store.

You can use / or \ as separator between path elements.

The folderType field specifies the root of the folder.

You can use the following list of roots in the folderType field:
  • oIFolderInbox

  • oIFolderDeletedItems

  • oIFolderDrafts

  • oIFolderJunk

  • oIFolderOutbox

  • oIFolderSentMail

  • oIFolderRssFeeds

The storeName field specifies the name of the Outlook store. If you don’t specify any store name in this field, the Outlook default store name gets selected.