Get Text

The Get Text activity extracts a text value (name, type, or value) from an interface element. The value of the selected element is copied to the process context variable.

начало внимание

The activity cannot be used if the process does not contain at least one context variable.

конец внимание

Activity settings

Activity settings are configured automatically when recording a process.

1. Call the radial menu in the recording mode pressing the Ctrl+Alt+Q combination, which is set by default.  You can change this combination in the designer settings.

2. Click on the 1 icon and select the process variable. You can select it from the list or create a new one by clicking the Create parameter button.

get-text-1

3. Now the bot will save the value of the selected element (Full name fields, for example) to the context variable, which can be used in the process.

After saving the process, the Get Text activity will be added to the process diagram.

You can change the configured settings if you need. To open the settings window, click on the activity on the process diagram.

Get list/table

Use this option of the radial menu to extract text from several interface elements. For example, you can use it to get data from the Windows Explorer elements or the 1C system elements (version 8.3.13 or later).

  1. Click clip0001and select List or Table.

get-text-2

  1. Select List to extract and write elements’ values to an array. First, all the child elements will be highlighted in red.
  2. Select an element. Its features will be taken as an example for extracting data from other elements. The selected area will be highlighted with yellow.

get-text-3

Select Table to extract data and save it to the Table type variable. The setting of the extracted table data is similar to the setting of the extracted data when recognizing a list.

3. Click Continue. In the window that opens, configure the activity settings.

get-text-4

Table

Here you can view the elements to recognize.

Set parameters to recognize

  • Parameter. A variable that will store the extracted data. When recognizing lists and tables, you can select only Array and Table type variables respectively.
  • Feature to read. Indicate the data to extract:
    • Name. The element name;
    • Type. The element type in the string form. For example, Edit — the field for entering data, List Item — an element from the list;
    • Value. The element value.
  • Pattern to read — A regular expression for the text fragment search.

Regular expressions can be used without leading and trailing slashes:

.*target words.*

You can use a context variable. You can insert the pattern into the variable or even combine them:

.*{$pattern}.*

where pattern is a context variable.

Example of using regular expressions

After saving the process, the Get Text activity will be added to the process diagram.

You can change the configured settings if you need. To open the settings window, click on the activity on the process diagram.

Parameters Tab

The Parameters tab displays the basic activity parameters, target parameters, and control parameters.

get-text-2

Basic parameters:

  • Name. The activity name on the process diagram. It is set by the template when adding the activity. If you want to change the name, you can do it in this field;
  • Property to read. Indicate the data to extract:
    • Name. The element name;
    • Type. The element type in the string form. For example, Edit — the field for entering data, List Item — an element from the list;
    • Value. The element value. Only the elements intended for entering or changing data have a value, for example, a text field, a checkbox, a data field, etc.  

For example, you can extract the following data from the OK button on the file saving form: element name — OK, type — Button, value — empty.

For the Notepad program: name — Text editor, type — Edit, value — the text you entered.

  • Pattern to read. A regular expression for the text fragment search.

The regular expression can be used without leading and trailing slashes:

.*target words.*

You can use the context variable. The pattern can be inserted into a variable or even combined:

.*{$pattern}.*

where pattern is a context variable.

Example of using regular expressions

  • Parameter. Select the process context variable for keeping the extracted text in.

Read more about target and control parameters in the "Basic activity settings principles" article.

Conditions Tab

Read more about the Conditions tab in the "Basic activity settings principles" article.