- Overview
- Excel
- Release Notes
- About the Excel activity package
- Project Compatibility
- Supported character encoding
- Project Settings
- Add or Update Excel Sensitivity Label
- Append Range
- Auto Fill
- Autofit Range
- Change Pivot Data Source
- Clear Sheet/Range/Table
- Copy/Paste Range
- Create Pivot Table
- Delete Column
- Delete Rows
- Delete Sheet
- Duplicate Sheet
- Export to CSV
- Fill Range
- Filter
- Filter Pivot Table
- Find First/Last Data Row
- Find/Replace Value
- For Each Excel Row
- For Each Excel Sheet
- Format As Table
- Format Cells
- Get Cell Color
- Get Excel Chart
- Get Excel Sensitivity Label
- Get Selected Range
- Insert Column
- Insert Chart
- Insert Rows
- Insert Sheet
- Invoke VBA
- Lookup
- Match Function
- Protect Sheet
- Read Cell Formula
- Read Cell Value
- Read Range
- Refresh Excel Data Connections
- Refresh Pivot Table
- Remove Duplicates
- Rename Sheet
- Run Spreadsheet Macro
- Save Excel File
- Save Excel File As
- Save Excel File As PDF
- Select Range
- Sort Range
- Text to Columns
- Unprotect Sheet
- Update Excel Chart
- Use Excel File
- VLookup
- Write Cell
- Write CSV
- Write DataTable to Excel
- Excel Application Scope
- Append To CSV
- Read CSV
- Write CSV
- Delete Column
- Filter Table
- Get Table Range
- Insert Column
- Sort Table
- Append Range
- Close Workbook
- Get Cell Color
- Read Cell
- Read Cell Formula
- Read Column
- Read Range
- Read Row
- Select Range
- Set Range Color
- Write Cell
- Write Range
- Save Workbook
- Create Table
- Get Workbook Sheet
- Get Workbook Sheets
- Refresh Pivot Table
- Create Pivot Table
- Get Selected Range
- Copy Sheet
- Delete Range
- Auto Fill Range
- Copy Paste Range
- Execute Macro
- Insert/Delete Columns
- Insert/Delete Rows
- Invoke VBA
- LookUp Range
- Remove Duplicates Range
- Excel Process Scope
- Manage CSV Files
- Filter CSV Files
- Verify CSV Files
- Table Functions
- Manage Multiple Excel Files
- Interpret Excel Results
- Manage Pivot Tables
- Manage Range Selection
- Read From Excel Files
- Manage Databases in Excel
- Compare CSV Files
- Compare Numeric Values
- Sort Data in Excel Files
- Filter and Delete Rows in Excel Files
- Manipulate Range Selections
- Verify Excel Workbook Data
- Read, Write, and Append Data in Excel
- Google Workspace
- Release notes
- About the Google Workspace activities package
- Project compatibility
- Wait for Calendar Event Created and Resume
- Wait for Calendar Event Received and Resume
- Wait for Calendar Event Replied and Resume
- Wait for Calendar Event Updated
- Wait for Email Received and Resume
- Wait for Email Sent and Resume
- Wait for File Created and Resume
- Wait for File Updated and Resume
- Wait for Folder Created and Resume
- Wait for Sheet Created and Resume
- Wait for Sheet Cell Updated and Resume
- Wait for Task Created and Resume
- Wait for Task Completed and Resume
- Add Attendee
- Create Event
- Delete Event
- Modify Event
- Search Events
- Use Google Drive
- Share File
- Delete File Permission
- Get File Permissions
- Update File Permission
- Copy File
- Create Folder
- Delete File
- Download File
- Find Files and Folders
- Get File Info
- Move File
- Upload File
- Create Document
- Create New Spreadsheet
- Get Mail Messages
- Send Mail Messages
- Change Labels
- Use Google Spreadsheet
- Add Delete Columns
- Add Delete Rows
- Auto Fill Range
- Add New Sheet
- Append Row
- Batch Spreadsheet Updates
- Copy Sheet
- Copy Paste Range
- Delete Range
- Delete Sheet
- Get Cell Color
- Get Sheets
- Read Cell
- Read Column
- Read Range
- Read Row
- Rename Sheet
- Write Cell
- Write Range
- Clear Range
- Download Spreadsheet
- Use Google Document
- Batch Document Updates
- Get Document
- Get Text Index
- Insert Text
- Replace Text
- Read All Text
- Create Script Project
- Get Project Content
- Upload Script File
- Create Deployment
- Run Script
- Mail
- Microsoft 365
- Release notes
- About the Microsoft 365 activity package
- Project compatibility
- Connections
- AddEmailCategories
- ArchiveEmail
- DeleteEmail
- DownloadEmail
- DownloadEmailAttachment
- DownloadEmailAttachments
- ForwardEmail
- GetEmail
- GetEmailAttachmentsInfo
- GetEmails
- GetMailFolders
- GetNewestEmail
- MarkEmailAsRead
- MarkEmailAsUnread
- MoveEmail
- RemoveEmailCategories
- ReplyToEmail
- SendEmail
- TurnOffAutomaticReplies
- TurnOnAutomaticReplies
- Merge multiple sheets into a new summary Excel sheet
- Automatically accept calendar invites from your manager
- Move files to dedicated folders by type
- Verify if new employment documents (I9 and ID) match
- Add new customers to a SharePoint List
- Delete SharePoint List items newer than yesterday
- Notify me on Slack when an important Outlook Email is received
- Include creation date in new OneDrive file names
- Notify me by email when a new file is created
- Microsoft 365 Scope
- Add Sheet
- Append Range
- Clear Range
- Copy Range
- Copy Sheet
- Create Workbook
- Delete Range
- Delete Sheet
- Get Cell Color
- Get Sheets
- Read Cell
- Read Column
- Read Range
- Read Row
- Rename Sheet
- Write Cell
- Write Range
- Set Range Color
- Create Table
- Get Table Range
- Insert Column
- Delete Column
- Insert Rows
- Delete Rows
- VLookup Range
- Use OneDrive & SharePoint
- Copy File/Folder
- Create Folder
- Delete File/Folder
- Download File
- Export File as PDF
- Find Files And Folders
- Get File/Folder
- Move File/Folder
- Upload File
- Share File/Folder
- For Each File/Folder
- Forward Mail
- Get Mail
- Move Mail
- Send Mail
- Reply to Mail
- Delete Mail
- Set Mail Categories
- Add Attachment
- Add Attendee
- Add Location
- Create Event
- Delete Event
- Find Meeting Times
- Get Calendars
- Modify Event
- RSVP
- Search Events
- Create Group
- Delete Group
- Get Group
- List Groups
- Create Bucket
- Delete Bucket
- List Buckets
- List Bucket Tasks
- Create Plan
- Get Plan
- List Plans
- Create Task
- Delete Task
- Get Task
- List Tasks
- Update Task
- For Each List
- Get List Info
- For Each List Item
- Delete List Item
- Add List Items
- Update List Item
- Get List Items
- Authentication troubleshooting
- AADSTS50011: Redirect URI mismatch
- AADSTS50076: Using multifactor authentication
- AADSTS50079: The user is required to use multifactor authentication
- AADSTS500113: No reply address registered for the application
- AADSTS65001: The user or administrator has not consented to use the application
- AADSTS7000218: The request body must contain the following parameter: client_assertion or client_secret
- AADSTS70002: InvalidClient - Error validating the credentials
- AADSTS50055: The password is expired
- AADSTS700082: The refresh token has expired due to inactivity
- AADSTS50194: Application is not configured as a multitenant application
- Mail troubleshooting
- Calendar troubleshooting
- Files troubleshooting
- Sheets troubleshooting
- Presentations
- Release Notes
- About the Presentations activity package
- Project Compatibility
- Add or Update Powerpoint Sensitivity Label
- Add Data Table to Slide
- Add File to Slide
- Add Image or Video to Slide
- Add New Slide
- Add Text to Slide
- Copy Paste Slide
- Delete Slide
- Format Slide Content
- Get Powerpoint Sensitivity Label
- Replace Text in Presentation
- Paste Item Into Slide
- Run Presentation Macro
- Save PowerPoint File As
- Save Presentation as PDF
- Use PowerPoint Presentation
- Word
- Release Notes
- About the Word Activities Package
- Project Compatibility
- Word Application Scope / Use Word File
- Add or Update Word Sensitivity Label
- Add Hyperlink to Document
- Add Picture
- Append Text
- Get Word Sensitivity Label
- Insert DataTable in Document
- Paste Chart/Picture Into Document
- Read Text
- Replace Picture
- Replace Text in Document
- Save Document As
- Save Document as PDF
- Set Bookmark Content
Verify if new employment documents (I9 and ID) match
Summary: Extract I9 and ID documents arrived by email and verify if both documents have the same holder. The email is moved, categories are set, and reply or forward actions are performed based on checks.
Applications: Outlook Email, Document Understanding
Description: This examples explains how to create a workflow that verifies new employment documents (I9 and ID). When a new email arrives containing a specific subject with attachments, the robots get triggered to download the two attachments and verify if the two attachments are ID and I9 documents. After validation, it extracts the content from the two documents and verifies if they belong to the same person, by checking the first name and last name. Once the documents are checked, the email is moved to a specific folder (Valid Submissions / Invalid Submissions), categories are set, and the email is forwarded if valid, or a reply is sent back to the sender if it is invalid.
This example presents Microsoft 365 activities such as Email Received, Download Email Attachments, Move Email, and Document Understanding activities.
- Open Studio Web and create a new project.
- For How to start the automation select Event based, then select the Microsoft 365 Email Received trigger activity.
- In the trigger activity:
-
Set up your Microsoft OneDrive & SharePoint connection.
-
Set the Email folder field. For example, Inbox.
- Set the Additional filters to be as specific as possible. For example, in this case, set the filter as: Subject contains New employment.
- Set the optional fields:
- With attachments only - On.
- Include attachments - True.
- Mark as read - False.
-
- Add a Log Message activity to record the received email's subject. In the Text field, select the output variable of the trigger activity and drill down to identify its Subject property:
- Next, add two consecutive Download Email Attachments activities. At this step in the workflow, the attachments containing the required documents (I9 and ID) are downloaded. Configure
the activities as follows:
- First, rename each activity, to easily identify them further in the workflow. For example: Download Email Attachments - containing I9, type PDF and Download Email Attachments - containing ID, type PDF.
- Set up your Microsoft Outlook 365 connection.
- For the Email field, select the output variable of the trigger activity.
- Set up the Advanced filter to determine what type of documents you want to download:
- Set Exclude inline attachments to False.
- Next, add an If activity to verifiy if the two attachments are indeed ID and I9 documents.
- Set the Condition to check if the output variables of the two Download Email Attachments activities equal 0 (i.e., no documents were identified using the set filters):
- Set the Condition to check if the output variables of the two Download Email Attachments activities equal 0 (i.e., no documents were identified using the set filters):
- Configure the Then branch of the activity, i.e., the activity to execute in case the condition is true. Add a Reply to Email activity. Its purpose is to notify senders that their documents were not submitted properly. See an example of how to configure
this activity below:
- Right next to the Reply to Email activity (inside the Then branch), add a Throw exception activity and configure it as follows:
- Next, we'll use Document Understanding activities to extract the content from the two documents and verify they belong to the same holder by checking the first name and last name in each document.
- Add a Document Understanding Classify Document activity. Rename it to Classify I9 Attachment Document.
- For the Input field, select the output variable of the Download Email Attachments - containing I9, type PDF activity.
- For the Input field, select the output variable of the Download Email Attachments - containing I9, type PDF activity.
- Add a Log Message activity, to log the I9 document type. In the Message field, select the output variable of the Classify I9 Attachment Document activity and drill down to Document Data to find the
DocumentType
property. - Next, add an If activity, to verifiy the I9 document classification. Configure the condition as follows:
- Select the output variable of the Classify I9 Attachment Document activity, then drill down to Document Data > Document Type > Name > Name.
- Set the condition: Name contains i9. In the Expression editor, the condition looks like this:
_out_ClassifyDocument_1__ClassificationResults.DocumentType.Name.Contains("i9")
.
- For the Then branch, add an Extract Document Data activity. Configure the activity as follows:
- For the Extractor field, select I9 from the dropdown list.
- For Input file, select the output variable of the Download Email Attachments - containing I9, type PDF activity.
- For the Else branch, i.e., the activity to execute in case the condition is false, add:
- A Log Message activity, with the following message: The Email doesn't contain an I9 Form.
- A Throw exception.
- Next, add another Classify Document activity, to classify the ID documents. Rename it to Classify ID Attachment Document.
- For the Input field, select the output variable of the Download Email Attachments - containing ID, type PDF activity.
- For the Input field, select the output variable of the Download Email Attachments - containing ID, type PDF activity.
- Add a Log Message activity, to log the ID document type. In the Message field, select the output variable of the Classify ID Attachment Document activity and drill down to Document Data to find the
DocumentType
property. - Next, add an If activity, to verifiy the ID document classification. Configure the condition as follows:
- Select the output variable of the Classify ID Attachment Document activity, then drill down to Document Data > Document Type > Name > Name.
- Set the condition: Name contains id_cards. In the Expression editor, the condition looks like this:
_out_ClassifyDocument_2__ClassificationResults.DocumentType.Name.Contains("id_cards")
.
- For the Then branch, add an Extract Document Data activity. Configure the activity as follows:
- For the Extractor field, select ID Cards from the dropdown list.
- For Input file, select the output variable of the Download Email Attachments - containing ID, type PDF activity.
- For the Else branch, i.e., the activity to execute in case the condition is false, add:
- A Log Message activity, with the following message: The Email doesn't contain an ID.
- A Throw exception.
- Next, add a series of Log Message activities to record the First Name and Last Name on the I9 and ID documents.
- In the Message Field, write I9 First Name, then drill down to the Variables section >
I9_Doc
>Data
>EmployeeFirstName
. - Repeat step 22a for
I9
-Last Name
, then forIDCard
>FirstName
andIDCard
>LastName
.
- In the Message Field, write I9 First Name, then drill down to the Variables section >
- Add an If activity, to verify if the first name and last name in each I9 and ID match. Set the condition as follows:
I9_Doc.Data.EmployeeFirstName.Value.ToLower.Trim
containsIDCard.Data.FirstName.Value.ToLower.Trim
I9_Doc.Data.EmployeeLastName.Value.ToLower.Trim
equalsIDCard.Data.LastName.Value.ToLower.Trim
- For the Then branch, add:
- A Log Message activity to state that the I9 and ID match.
- A Move Email activity, configured as follows:
- Email to move - Select the output variable of the initial trigger Email Received activity.
- To email folder - For example, a Valid Submissions folder.
- A Set Email Categories activity, to assign a Valid Submission category to the moved email.
- A Forward Email activity, if you want to forward the moved email to someone.
- For the Else branch, add:
- A Log Message activity to state that the I9 and ID don't match.
- A Move Email activity, configured as follows:
- Email to move - Select the output variable of the initial trigger Email Received activity.
- To email folder - For example, an Invalid Submissions folder.
- A Set Email Categories activity, to assign an Invalid Submission category to the moved email.
- A Reply to Email activity, to remind the sender that their email was considered invalid because of the documents.
- You're done and ready to run your project!