Use Case

Estimated reading: 4 minutes 2139 views

Objective: Automate the secure storage of employee documents by uploading them from local storage to Google Drive.

Description: Currently, the HR department receives employee documents via email and manually saves them to a local system. To enhance document security, the company aims to store these files on Google Drive instead. Automating this process will ensure secure, centralized storage while reducing manual handling.

Pre-requisites: Connection to the Google Drive is required.  

Steps to execute a bot

In the following steps, we have created an application named “W3 schools – website”. To get detailed information on how to create an application,

1. Create a solution named as “GoogleDrive”.
2. Drag and drop the “Read” activity from the “EmailAutomation” feature.
a. It helps to read and extract unread mails received from the employee.
b. Double click on the activity and provide the “Account name” and “Folder Name” as your outlook account address. 
c. Provide the “Foldername” as “Inbox” to read the mails.
d. Provide “UnRead” as “True”.
e. Declare a variable as “Read_ml” in the “List” property to store the read mails in a variable for further processing. It will be used as input in other email activities.
     i. Method 1 – Click on the “List” property within the “Read” activity and enter the variable name. In this case, we are using “Read_ml” Then, press “Ctrl+Q,” which is a shortcut key to create a variable. 
    ii. Method 2 – Click on the Variables pane and enter the name “Read_ml.” Then, in the “Variable Types” column, select “Browse for Types” from the dropdown menu.
   iii. The .Net window for data types will appear on the screen, enter the type of name as “System.Collections.Generic.List” and choose “Microsoft.Office.interop.Outlook.MailItem” then click on “OK” button.
3. Next add the “Assign” activity from “Primitives” feature next to the “Read” activity. 
a. Here create a variable with “String” datatype as “UploadPath” and assign the path where the attachment from the email needs to be saved.
4. Now, Add the “Extract Mail Message” activity next to the assign activity. 
a. In the “AttachmentPath” property, provide the variable as “UploadPath” to save the attachments from email. 
b. Choose the “InputType” as “MailItem” from the drop-down as we are using the “Read_ml” variable as input here.
c. Specify the “MailItem” as “Read_ml(0)” here to extract the values from the mail using the variable.  
5. Let’s create folder in the “Google Drive” to upload the attachments against it.
a. Drag and drop the “CreateFolder” activity from Google Drive feature. 
b. In the “FolderName” property, provide the value as “Employee1”.
c. Choose a “Parent directory” folder in the Google Drive where it needs to be created. 
d.  Move to the “Folder ID” in the output section of the activity to declare a variable to get the created Folder ID. 
     i. Provide the variable name as “Employee_FID” and press “CTRL+Q” to create a variable. 
6. Next, add the “GetFolderInformation” from the “FS Automation” feature to iterate and collect the list of attachments to upload them to Google Drive. 
a. Double click on the activity and provide the “FolderPath” as “UploadPath” variable.   
b. Declare a variable in the “Files” in the output section as “Emp_Files” to retrieve the files list from the provided path. 
7. Place the “For each” activity next to the “GetFolderInformaion” activity to iterate collection of files to upload them. 
a. Enter “Emp_Files” as the input value here, in which is where we have stored the read mails.
b. The values from “Emp_Files” have been assigned to the “Item.”
c. Select “String” as the “TypeArgument” since it’s a list of string.
8. Next add the “Assign” activity from “Primitives” feature inside the “ForEach” activity. 
a. Here create a variable with “String” datatype as “FDPath” to concatenate the path along with file name received from Get Folder information activity.
b. In the “Value” parameter, provide the value as UploadPath + “\” + item. 
9. Now, add the “Upload File” activity into the For each sequence.
a. In the “FilePath” property, provide the value as “FDPath” to upload the file that has been collected from local system. 
b. Move to the “DestinationFolder” and provide the value as “Employee_FID” variable that has been created as output in the “Create Folder” actiivty. 
10. Now, save and execute the bot. 

The bot will read and extract the attachments from the mail to the provided path. Then creates a folder as “Employee1” in connected google drive to upload the attachments. 

Share this Doc

Use Case

Or copy link

CONTENTS