Skip to end of metadata
Go to start of metadata

Welcome Reusable Components for Intelligent Automation Cloud – Express and Business

What is this?

The page contains the list of reusable components which will help you to implement your personal use case immediately.

Download examples and samples of scripts that show bot execution in different automation scenarios.

Each bot sample contains REUSABLE components.

  1. Select an interesting script and download the example. 
  2. Import the example and see automation in action. For more information, refer to How to Copy Reusable Components.
  3. Use the whole example or reusable components for your own automation.

List of Reusable Components

TitleDescriptionDownloadActions viewActions descriptionHow to reuse

Calculate period for press-releases

The group of actions is required to calculate period of dates from the current date to seven days before today. The whole group is reusable in other projects.

image2019-2-7_13-52-56.png

Constant value action 2 saves current date to the Date variable current_date.

Groovy script in step 3 calculates the period of date in the variable current_date to seven days before and saves to the start_date variable.

Change the text on the 6th row of the script Period.ofWeeks(1) to the period you would like to calculate. For example:
  • Period.ofWeeks(2) – calculate the date two weeks before today
  • Period.ofDays(3) – calculate the date three days before today

Send email with attachment via Outlook

The group of actions is required to open Outlook and to send the email with the press releases attached. The whole group is reusable in other projects.


In actions 80-84, we open Outlook. The bot opens the Run window, types 'Outlook', and then opens Outlook.

With the help of the Window action, the bot switches to the specified window and ignores any random popups.

In actions 85-110, we send an email with the specific subject and the attached file to the email from the user_email variable. We will use the Enter Keystrokes, Click Mouse (via Inspector) and Window actions.

The exception handlings are added as some window titles and elements differ in various versions of Outlook. The script below works for Outlook from 2007 to 365.

The exception handling on step 85 is added due to the window title difference in Outlook versions.

The exception handling on step 92 is needed because of the difference in the Subject selector in Outlook versions.

Another exception handling on step 96 is added because the Attach file selector differs in Outlook versions.

The flow for attaching a file differs depending on the Outlook version, that's why exception on step 101 is added.

The exception handling on step 106 is added because the Send button selector differs depending on the Outlook version.

Change values of variables:
  • user_email – change the user email to send to, for example, test@test.com
  • subject – choose the subject to set into the variable value
  • file_path  set the right path for the file you want to attach, for example, C:\RPAExpress\invoices.xlsx

Close Outlook

The group of actions is required to close Outlook when the email is sent.

The bot enters Alt+F4 to close Outlook.

We've added the Wait action to give time for email to be sent.

Exception handling is added due to the window title difference in various Outlook versions.

The whole group is reusable in other projects without any adjustments.


Create folder – Temp

A folder with a random name is created.

image2019-2-15_18-34-19.png

Two variables are used:
  • str_temp_folder_path – the path to the directory where you want to create a temporary folder
  • str_temp_folder_name – a variable to store a random name
The whole group is reusable in other projects after providing values for 2 variables.

Create folder with name as current date

Create a folder with the name as the current date.

Three variables are used:
  • str_result_path – the path to the results directory where the folder will be created
  • date_current – a variable of the DateTime type
  • str_current_date – a variable to store a line with the current date
The whole group is reusable in other projects after providing values for 3 variables.

Convert file from .pdf to .txt

Convert a file from pdf to txt format

Two variables are used:
  • element – the path to the input PDF file
  • str_temp_folder_path_with_slash – the path to the temporary directory to save the result of the conversion to
The whole group is reusable in other projects after providing values for 2 variables.

Download file by direct link to folder

It is a custom action for downloading a file using a direct link to the folder. With this action, you can upload a file from the network and assign a name that is more convenient for you. The action replaces 15-20 standard actions with the browser and desktop and does not depend on the browser.

Four variables are used:
  • str_link_to_file – a direct link to a template or other file on the network
  • str_temp_folder_path_with_slash – the path to the folder where you want to download the file
  • str_result_file_name – the file name it will have after downloading
  • str_template_file_format – the variable should contain the file format, for example .xlsx, or you can add the file format to a variable with the file name and leave the variable empty.
The whole group is reusable in other projects after providing values for 4 variables.

Generate results

Gets all the files with the selected format from a temporary folder and saves them to the results folder.

Two variables are used:
  • str_temp_folder_path – the path to the temporary directory from which we will move files
  • str_result_path – the path to the resulting directory where we will move the files

The whole group is reusable in other projects after providing values for 2 variables.

Copy files content into clipboard

Copies the files text content into clipboard

The Get Folder Contents action reads a content of the defined folder including files, sub-folders, or both, and saves the results (full paths to the items) to a Recorder variable (List).change the value of the path_to_folder variable.

Convert .json to .csv and download file from website

Opens a website, adds data from clipboard to special area in the website, makes conversion from .json to .csv, downloads a file from the website, and opens the downloaded file.

The exception handling is added (10, 28) so the script can be opened in a default browser installed on your machine (Google Chrome, Mozilla Firefox, or Internet Explorer).

Click mouse action 14 specifies the area on the website for pasting data using XPath.

Click mouse action 22 specifies the button on the website for downloading the result .csv file using XPath.

change:
  • value of the url variablethe website url
  • XPath values in actions 14 and 22
  • (if your defalt browser is Internet Explorer) Window title in action 52 (open the website on a particular page and select the window title from the list)

Adjust Excel file

Makes adjustments to the Excel file.

Action 81 creates a full path to the Excel file by joining three variables of the String type.

Action 82 opens the Excel spreadsheet using the full_path variable.

Action 83 copies data from f2 to g6 and action 84 pastes it to the range of a2:b6.

Action 85 copies data from j2 to k6 and action 86 pastes it to the range of c2:d6.

Action 87 pastes empty cells from e1 to n6.

Actions 88-91 set the column names.

Perform the following steps.
  • Provide the correct path to the Excel file in action 82.
  • Specify the needed range in actions 83-87.
  • Set the right values for column names in the col1-col4 variables.

Send email to many people with attachment file via Outlook

Open Outlook and send an email with the Excel attachment to unlimited number of persons.

Actions 92-101 open Outlook. The bot opens the Run window, types 'Outlook', and then opens Outlook.

With the help of the Window action, the bot switches to the specified window and ignores any random popups.

Action 102 specifies that the bot will send as many letters as many elements (email addresses) are there in the mail_list variable.

Actions 104-130 send an email with the specific subject and the attached file to the email from the mail_list variable. To do that, you will need the Enter Keystrokes, Click Mouse (via Inspector), and Window actions.

The exception handlings are added as some window titles and elements differ in various versions of Outlook. The script below works for Outlook from 2007 to 365.

Action 104 adds the exception handling due to the window title difference in Outlook versions.

Action 111 adds the exception handling due to the difference in the Subject selector in Outlook versions.

Action 115 adds the exception handling as the Attach file selector differs in Outlook versions.

Action 120 adds the exception handling as the flow for attaching a file differs depending on the Outlook version.

Action 126 adds the exception handling as the Send button selector differs depending on the Outlook version.

Change the variables values.
  • mail_list – change the users email to send to. Add any quantity you need in the list variable.
  • subject – choose the subject to set into the variable value.
  • full_path  set the right path for the file you want to attach, for example, C:\Samples\report.xlsx and unmark action 123. The alternative way is to provide this path in three variables:
    • path_to_folder (for example, C:\Samples);
    • excel_file_name (for example, \report);
    • format_file (for example, .xlsx).

Scrape table from website and save to Table variable

The reusable element gets the text data from the table on the web page and copies it into a variable of the Table type.

The group must be inside the the Open Website or Switch to Browser action.

Input data:

  • str_table_xpath – the XPath to the table element on the page
  • str_btn_next_xpath (optional) – the XPath to the next page button
  • num_how_pages – the number of pages you want to scrap; if you want to scrap only one page, set the value "1" for the variable and you cannot set the value str_btn_next_xpath

Output data:

  • table_result – the type of the Table variable with data from a table or tables

Change variables values:

  • str_table_xpath
  • str_btn_next_xpath
  • num_how_pages

Create empty .xlsx file

The action creates an empty .xlsx file. This reusable element will be useful in your own projects, as you cannot create a file with the .xslx format using cmd. Also, it allows you not to create an .xlsx file before each example run.

The example will help solve the problem when in some situations you don’t know whether to create a file.

Before starting projects with this case, Excel should be closed.

Input data:

  • str_xlsx_file_path – the path to the directory where you want to create a new .xlsx file or open an existing one, for example: C:\TablesFolder (without a slash at the end)
  • str_xlsx_file_name – the file name; if a file with that name does not exist, it will be created, for example: testFile (without a format at the end)

Change variables values:

  • str_xlsx_file_path
  • str_xlsx_file_name
  • No labels