RobilityAI®

Header Example

Join us in improving our documentation .

Your insights matter! Let us know how we can enhance this page for you. Your feedback plays a crucial role in shaping our product, enabling us to craft clear, concise, and valuable documentation for all users.

Activities

Use Case

A report will be generated in a word document through mail in which the supervisor needs to. A Supervisor needs to extract the report of their website, which is generated through mail. After being extracted, these reports are transferred to a designated folder for further processing. Upon downloading the report, it’s essential to replace a text from the word document.

The report has been extracted from their website, in which there will be wrong replacement of words. Using the “ReplaceText” activity, we are going to replace the word from the specified document and store it in a folder.

The following illustration demonstrates the process of downloading the report and extracting the “Attachment” and “Received date” using the Email Automation feature.

In this scenario, the input will be a “MailItem” that is specifically designed for utilizing the “Email automation” feature. Using the email automation activities, we will extract and store the word document. Subsequently, the extracted values of the “Attachment” will be replaced and appended with a new text in the specified word document.

Steps to execute a bot

  1. Create a solution named “Report Extraction.”
  2. Now, drag and drop the “Create Directory” activity from the “FS Automation” feature and set it as start node.
      a. This activity is used to create a folder in the specified path on the user’s machine. Here are creating this folder to download the      document from the mail.
      b. Double click on the activity and enter the folder name as “REPORT” in the “Name” property.
      c.Provide the “full path” where you want to create the folder.
  3. Place the “READ” activity from the Email Automation feature next to the “Create Directory” activity.
      a. It helps to read the mail from the specified outlook account and store the mails in the “MailItem” in a list format.
      b. Double click on the activity and enter the “Account Name” as “YourMailID” in the property.
      c. Specify the “YourMailID” in the “FolderName” property as well. This property is used to integrate with the account name provided.
      d. Navigate to the properties and specify the “No.of.Mails” as “1” for the activity to read the number of mails from the specified            outlook account.
      e. Set the “SortBy” field as “Ascending” from the drop-down to sort and read the mails in ascending order.
      f. Choose the “SortByFieldName” as “ReceivedDate” from the drop-down to sort and read the mails with the received date in              ascending order.
      g. Enter the “SubFolderName” as “Inbox” in the property to choose the folder name from which the mails has to be read.
      h. Specify “True” in the “Unread” property to read only the mails which has not been read.
      i. Declare a variable as “Read_ml” in the “List” property and press “CTRL+Q” to store the read mails in a variable for further                processing. It will be used as input in other email activities.
      j. Click here to see how to declare a variable with “Mailitem”.
  4. Place the “For each” activity next to the read mail to iterate each mail from the “Read_ml” variable for further process of saving the report and extracting the values.
      a.Enter “Read_ml” as the input value here, in which is where we have stored the read mails.
      b. Now, the values from “Read_ml” have been assigned to the “Item.”
      c. Select “MailItem” as the “TypeArgument” since it’s a list of mailitem.
  5. Drag and drop the “ExtractMailMessage” activity inside the “For Each” activity.
      a. Navigate to the properties and provide the “AttachmentPath” as the folder path to extract and store the report from the mail.
      b. Choose the “InputType” as “MailItem” from the drop-down as we are using the “item” variable as input here.
      d. Specify the “MailItem” as “item” here to extract the values from the mail using the variable.
      e. Declare a variable in the “ReceivedDateTime” as “RDT” to extract the received date and time from the mails.
      f. There are two methods to create a variable –
         i. Method 1 – Click on the ” ReceivedDateTime ” property within the “ExtractMailMessage” activity and enter the variable name.         In this case, we are using ” RDT.” 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 ” RDT.”Then, in the “Variable Types” column, select “Browse for          Types” from the dropdown menu.
  6.       Now, place the “WriteLog” activity next to the ExtractMailMessage activity. 
       a. Here we are using this activity to print the received date and time from the extracted mail item.
       b. Enter the “Input” text as “RDT.ToString” in the box.
       c. The “.ToString” is advised to use along with anyother data types other than string format. It converts any data type into string.
       d. Enter the log level as “Info”.

  7. Drag and drop the “GetFolderInformation” activity to workflow.
       a. It helps to extract the specified folder information. Here we are using this activity to get the file name extracted from the mail.
       b. Enter the folder path as the path created above.
  8. Declare a variable in the “Files” as “Filename” to extract the name of the file.
       a. There are two methods to create a variable –
       b. Method 1 – Click on the ” Files ” property within the”GetFolderInformation” activity and enter the variable name. In this case, we     are using ” Filename.” Then, press “Ctrl+Q,” which is a shortcut key to create a variable.
       c. The .Net window for data types will appear on the screen, enter the type name as “System.Collections.Generic.List<String>”           and then click on “OK” button.

     9. Moving to the “Result_Msg” property in the output section to declare a variable to view the output.
     There are two methods to store the spied value in the variable.

i. Method 1: Double-click on the variable parameter in the “Output” section and enter a name that helps you easily identify it in the flow. Here, I’m using the name “Result” and using the shortcut key “Ctrl+Q” to create the variable
ii. Method 2: Click on the variable pane, enter your preferred name (here, I’m using “Result”), and choose the data type as “String” since the output value accepts the string data type.

Now, save and execute the workflow.

 
Previous