Skip to main content
Version: 10.3.1

Reusable components

General information

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

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.

Download component

Actions description

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.

How to reuse

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.

Download component

Actions description

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, Mouse Click, 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.

Exception Handling on step 85 is added due to the window title difference in Outlook versions.

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.

Exception Handling on step 106 is added because the Send button selector differs depending on the Outlook version.

How to reuse

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.

Close Outlook

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

Download component

Actions description

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.

How to reuse

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

Create folder

A folder with a random name is created.

Download component

Actions description

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.

How to reuse

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.

Download component

Actions description

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.

How to reuse

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

Download component

Actions description

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.

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.

Download component

Actions description

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 filename 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 filename and leave the variable empty.

How to reuse

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

Generate results

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

Download component

Actions description

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.

How to reuse

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 the clipboard.

Download component

Actions description

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).

How to reuse

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.

Download component

Actions description

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).

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

Mouse Click action 22 specifies the button on the website for downloading the result CSV file using XPath.

How to reuse

Change:

  • Value of the url variable: the website URL.
  • XPath values in actions 14 and 22.
  • If your defalt browser is Internet Explorer, the 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.

Download component

Actions description

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.

How to reuse

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.

Download component

Actions description

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, Mouse Click, 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 Exception Handling due to the window title difference in Outlook versions.

Action 111 adds Exception Handling due to the difference in the Subject selector in Outlook versions.

Action 115 adds Exception Handling as the Attach file selector differs in Outlook versions.

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

Action 126 adds 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.

Download component

Actions description

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.

How to reuse

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 XLSX 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.

Download component

Actions description

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 filename. If a file with that name does not exist, it will be created, for example, testFile (without a format at the end).

How to reuse

Change variables values:

  • str_xlsx_file_path
  • str_xlsx_file_name

How to copy reusable components

To add a reusable component to your Recorder recording, perform several easy steps.

  1. Adjust the Recorder interface window to have two recordings available on one screen. To do this, simply drag and drop a needed RPAE file down to the area where a recording workflow is displayed.

  2. Select the appropriate group of actions you want to copy and drag and drop it from one recording to another.

  3. Return to one recording view in the Recorder window. To do it, just drag and drop the recording from one window to another.

    Now, the reusable component is added to your recording.

caution

Be aware that copying a reusable component from one recording to another doesn't copy its variables! The variables have to be created from scratch with the defined type and values. Variable names should be unique.