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 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 icon and select the process variable. You can select it from the list or create a new one by clicking the Create parameter button.
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.
The Parameters tab displays the basic activity parameters, target parameters, and control 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, Button, 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 — Save, 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:
You can use the context variable. The pattern can be inserted into a variable or even combined:
where pattern is a context variable.
Let's say you have a Manufacture date variable of the Date/Time type, and the MM-dd-yyyy format. Set the pattern:
This setting allows you to read the date from "Manufacture date: 09-28-2019". First, the substring containing the date will be distinguished from the string using the regular expression. Then the substring will be transformed to the Date/Time type considering the format.
- 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.
Read more about the Conditions tab in the "Basic activity settings principles" article.