# Calculator Action Triggers

Let's consider an example of a robot that simultaneously tracks different events in the interfaces of other programs and, depending on the event that occurs, performs different actions: displaying a message, a window, creating a document, navigating to a website, sending an email.

**Note:** *Before starting the project, you need to launch the Calculator (tested with Windows 10) and enter the required number on the calculator for the corresponding event to trigger.*

The project diagram looks like this (for convenience, the blocks in the diagram are numbered):

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf3WQsHGHYugUvPzu308yojZWkCRtRtJjOf_pJKoZR120a6Kd-imlpZk3Rnjhi2AGt4cSQz65iLbwBRB6PiMzu8qVfwSc4911Tj5Q-kv29WfT3UrOW9WPHbR96sXxfeUfJ8ilJgMXiObveND283ix-jABY?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

In this example, connectors are used. They are needed to make the project diagram easy to read.

1. **Block "Start"** (any diagram begins with this block).
2. **Block "Parallel Selection"** allows for pseudo-parallel execution of one of the blocks directly connected to its outputs, selecting the block that does not encounter an error, and after successfully executing such a block, continue the script's operation. A connected block is considered successfully executed if it does not trigger an error (exception). For this block, the property "Timeout" is specified (the maximum time to wait for block execution in seconds).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcEVFtvAnigyhArmIkbsRL1-CONtmHTLh8Nz3W6tDHLTWYrL76dUyDsQBdPEYYyY8l18XpEaVHEJgTr7jRByoQIZrnUBxxhoCY2PxXWmJUkLmQvxSGQ7FFYoNBjIjc553ZqHCJhV3ZcZwE0yyZRM7cqmcCT?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

3. **Block "Control Element"** checks that the element with the specified selector is in one of the specified states. The following properties are specified for this block:

* Selector (identifier of the user interface element);
* Process ID (variable that stores the process identifier, indicates which application to work with);
* State (the state that needs to be checked; in this case, an attribute is checked);
* Comparison Type (type of comparison; in this case, the type "Wildcard" is specified);
* Comparison Value (the value with which the obtained attribute value will be compared, in this case: 365);
* Expected Response (the expected value after the check);
* Attribute (the name of the attribute);
* Delay Before (delay before executing the block in seconds);
* Delay After (delay after executing the block in seconds);
* Timeout (maximum wait time for the specified element in seconds).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfEysYNoslf0FqSna4dC3iv-eCMuNzSYYtjW_mcufmJrLNuZZPhrXfyANUtz1mCmAmXXeRNWNQ37x3q4dU2STcBvH7tMW3p1iFBKU6zc-N4-NSU54x2R2kfJwJiMSEYA4UzsyvIABJjThnvlhCNyoVI3B4n?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

4. **Block "Message Window"** shows the user a modal dialog window with a specified title, text, and set of buttons. The following properties are specified for this block:

* Message (a variable that will be displayed inside the dialog window, in this case: “Value 365 detected”);
* Buttons (buttons that will be available for the user to click).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc1DMbMl9QcMqk_ouadOWWrCLCLD8xkOHkdIgZwlEMST3_D5Z0_5ulYTi8fVzg1_P1etVPtj_vNugtGtWXnhF7qMlhKur-EZca60_PSKxwZk16g-ikTzy80hm1qKAZnXu_05E3Yx8BVOYZ_LJDeB4Gusv66?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

<br>

5. **Block "Control Element"** checks that the element with the specified selector is in one of the specified states. The following properties are specified for this block:

* Selector (identifier of the user interface element);
* Process ID (variable that stores the process identifier, indicates which application to work with);
* State (the state that needs to be checked; in this case, an attribute is checked);
* Comparison Type (type of comparison; in this case, the type "Wildcard" is specified);
* Comparison Value (the value with which the obtained attribute value will be compared, in this case: 893);
* Expected Response (the expected value after the check);
* Attribute (the name of the attribute);
* Delay Before (delay before executing the block in seconds);
* Delay After (delay after executing the block in seconds);
* Timeout (maximum wait time for the specified element in seconds).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfnkCN42N20wOJAy9fzlGBuHt8s6gYXUNd_3hyx3w8ok_5KxqkHvKTSx_k28irH8W4FvAS1MFJCnhSEZWV4mKOsOGJ6HtLGKi0CRiGQv-IRLaB_SxlQmdFiNfKJD-wQFT_S-9NAPZtd-E77iKND5B-xEQc?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

6. **Block "Show Window"** allows you to create your own windows (forms) and display them in modal and non-modal modes, including asynchronously relative to the script's flow. If a selector is specified, the coordinates of the created window will be bound to a control element in another application. To create and edit your window, use the "Edit..." button of the block, and to create reusable windows - the [“Window Editor”](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/rabota-v-sherpa-designer/osnovnoe-menyu/panel-razrabotka/menyu-dopolnitelno/redaktor-okon) button on the main toolbar. The following properties are specified for this block:

* Configuration (configuration string);
* Window Object (variable with the window object);
* Selector (identifier of the element to which the window is bound when displayed);
* Process ID (variable that stores the process identifier, indicates which application to work with);
* Binding Angle (selection of the window binding angle value).

Here, the "Show Window" block is added using the [user action recording tool](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/rabota-v-sherpa-designer/osnovnoe-menyu/panel-razrabotka/menyu-zapis/zapis-deistvii-polzovatelya).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfovPINBmNv2WizUw987CcOMxFqTF_w6g5R6vHWF-gnknABs6ZlVmq-U7yEF0I-xqS4jVtJGexbZwOn4ub6Lsour8yZOhEN9NI48phDBUKy9yjDCyOzBQpN9liNfiTb1qbkVla_y0jiUDBJiZL-_-8PxUCv?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

The window shown by the block was created using the "Window Editor" tool. You can view and edit it by clicking the "Edit..." button located inside the block.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfgQb11lVq88eTodgCkUg5D4oDKZ8cXokUSPf15sIEo_SAKjAawnDAQlub5dkgGix6wEt5mVoEvyZEA3DiZfwWar7aRYK1RwEFEteOrqUhRBxW2KZTwaRsaKh4eQjfkbUk3erMicKPZHG6lg2VlUc3JOeg3?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

7. **Block "Get Text"** allows you to obtain the visible text of the selected user interface element (label, text field, menu item, etc.). The following properties are specified for this block:

* Selector (identifier of the user interface element);
* Value Type (type of the extracted value, in this case, it is the name);
* Process ID (variable that stores the process identifier, indicates which application to work with);
* Timeout (maximum wait time for the specified element in seconds).
* Auto-scrolling (when the flag is set, the list will automatically scroll to the element that is out of the visible area).

Here, the "Get Text" block is added using the user action recording tool.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc2Ds_2P6CsWXgZsdNvAu0fmGm70oD_qm0cE55eL8rx9L_bZOUugxRffoqAt8dVkr-4BkgZ00Vvy1EVy_Thdf2ipPGWnQxnZJV9S7De1lDt55_mK-5xIM3IZSutqpCLjYlTp8If5bNt3EPkgIo5_QHMNqOH?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

8. **Block "Convert String"** allows you to convert a string into a specified format. The following properties are specified for this block:

* Text (input string);
* Conversion Type (type of conversion, in this case, the type "Int" is selected – it keeps only numbers in the string).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXejEmpkn7KVjpJsVsdCg5DL4Xsw8_3RtmlkhYGnP8LsqNz3h_1Pl1JogBela5w3tXIGDhE7vFOYHeeowTg_mX6nAVIsl0Jq2NBSLKbp0KoTJsPrOIpaTUuoI-6tvtDx1X7-VcPCaz3n19Vblz6bmH7wI_RV?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

9. **Block "Condition"** checks the specified condition for truth, after which the script execution continues towards the "Yes" output (if the condition is met) or towards the "No" output (if the condition is not met).

The condition is written in the format: “variable” equals (==)/ greater than (>)/ less than (<) “value”.

For example: $a == “Hello”, that is, if the value of the variable $a is equal to “Hello”, then the output is “Yes”, otherwise – the output is “No”.

$Result > 5, that is, if the value of the variable $Result is less than 5, then the output is “Yes”, otherwise – the output is “No”.

In this case, a condition for clicking a link is used, for which it is set: $ControlEvent != "". That is, if the variable $ControlEvent is not empty, then the output is “Yes”.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfvkv3qB9wq9LiX5Vlu-dpyfD3WqpTBXJY5rvgdE4NW75WPMZclsJQQq0nQjz8opv7xs7TttCfnPVnMRd_5pn_fDrnKoKldIb1qVhtVvzCNtfMmrcJfO-2tDyc0A7sEl63RKkva9u2hdIkNgdWyK9_Akydu?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

10. **Block "Control Element"** checks that the element with the specified selector is in one of the specified states. The following properties are specified for this block:

* Selector (identifier of the user interface element);
* Process ID (variable that stores the process identifier, indicates which application to work with);
* State (the state that needs to be checked; in this case, an attribute is checked);
* Comparison Type (type of comparison; in this case, the type "Wildcard" is specified);
* Comparison Value (the value with which the obtained attribute value will be compared, in this case: 35);
* Expected Response (the expected value after the check);
* Attribute (the name of the attribute);
* Delay Before (delay before executing the block in seconds);
* Delay After (delay after executing the block in seconds);
* Timeout (maximum wait time for the specified element in seconds).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdZR6CpQqCk0UBEKst4HKKswrC8bfzeoPSqstn2ZFY7GuQxa_t69InD0_LCqzkCE3e9N5O0vQ_gSJeZXtALwgRnaddeWoeymX9iQSlD58ire0j_yfNsiShVLzZu6TwaEww_eJzthjGQPv2tzPT1iGFo7gH5?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

11. **Block "Launch Browser"** launches the selected browser. The following properties are specified for this block:

* Browser Type (the browser that needs to be opened);
* URL (the link that should open when launching the browser);
* Timeout (the time to wait for the browser to open in seconds).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcYC9rpkV6a8FDhndRZcPfPpjYMQAKROcuQkeTy6Rs17VIFuPrz93LOY-rzLl7tcjDcsky7Wcuyw2POAmsfKkIxt7R7FT_yfiAj_IXXayTh383WMi5RpH4MhlHJ3_rLCKvKzoMPyCKiL1MpZOxZZDrtrS_9?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

12. **Block "Control Element"** checks that the element with the specified selector is in one of the specified states. The following properties are specified for this block:

* Selector (identifier of the user interface element);
* Process ID (variable that stores the process identifier, indicates which application to work with);
* State (the state that needs to be checked; in this case, an attribute is checked);
* Comparison Type (type of comparison; in this case, the type "Wildcard" is specified);
* Comparison Value (the value with which the obtained attribute value will be compared, in this case: 2,000);
* Expected Response (the expected value after the check);
* Attribute (the name of the attribute);
* Delay Before (delay before executing the block in seconds);
* Delay After (delay after executing the block in seconds);
* Timeout (maximum wait time for the specified element in seconds).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf5xTVUI8wLB09LpbdcB1RyNb8UlI1_vk0nChIY28stP3a9ftyAYumKvm8AqAX3PrTlEYbJfhdW-NXNiDcg_AXdI-SzlNvqx_EsPlxJq_ztNWT_RyfwRiyJQqdTgu-YBHXFGBGFj6rOuMaH_pgbZbopp23N?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

13. **Block "Create Document"** allows you to create a Word document. The following properties are specified for this block:

* Use COM (when the flag is set, work will be done using the installed Word);
* Visibility (when the flag is set in this property and in the "Use COM" property, the Word interface will be displayed on the monitor screen).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdTFMOXNn3aohsUPZtJr4jC62ZejV7jwEq2UYl1ZZZF-RNS1AGBlrmvPEFNiv8JT6_mibq2wUrFAvapQX2eFUgP9ZhMW-lRiCjlcVsVdd2iQNE_lYDWSDv7konqun3wbW8xZavDhOe0A76NYYhMrZBWKUi3?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

14. **Block "Write Text to Document"** allows you to write text to a Word document. The following properties are specified for this block:

* Document Link (link to the open Word document currently being worked on. The name of the variable in this property must match the name of the variable in the "Document Link" property of the "Create Document" or "Open Document" blocks from the Word group that were previously used to create or open this document);
* Text (the text that needs to be written to the document, in this case, the text looks like this: “This is a test document created because the number 2,000 was entered in the Calculator”).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe7btpfWm1f5P15KY-OG6ItzunPSyNYsphkhM7byQ830w7g6kkLD3r1kZfc1rdvCw0Bh2oecpFZEUOKpkXCBKATWpNX0P30OeQulPZm6plTohYABjEHPhgjkNrHT9GDdZd9A9YMt0uijVNE438SwCA2cB5C?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

15. **Block "Control Element"** checks that the element with the specified selector is in one of the specified states. The following properties are specified for this block:

* Selector (identifier of the user interface element);
* Process ID (variable that stores the process identifier, indicates which application to work with);
* State (the state that needs to be checked; in this case, an attribute is checked);
* Comparison Type (type of comparison; in this case, the type "Wildcard" is specified);
* Comparison Value (the value with which the obtained attribute value will be compared, in this case: 3,000);
* Expected Response (the expected value after the check);
* Attribute (the name of the attribute);
* Delay Before (delay before executing the block in seconds);
* Delay After (delay after executing the block in seconds);
* Timeout (maximum wait time for the specified element in seconds).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeoSx9Q1WYvkgiODg3RFUb2y29EaLq70wz48jIFF-9X3plZrfPCJ1q45pMS69Y-EcqWLMaflx-BBRyUpdfVpLh37pvIE0x8Bl57_t9qKy2Mq0gECexNT32u1byfMmK7yjpMyWKuljhNLuUUgZIgn-T_6KOH?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

16. **Block "Send Email"** allows you to send an email using the SMTP protocol. The following properties are specified for this block:

* Email Subject (the subject of the email, in this case: “New Event in Calculator”);
* Email Text (the text of the email, in this case: “User entered 3,000”);
* HTML Markup (when the flag is set, the content of the email will be sent as an HTML page and may contain tags);
* Timeout (the time to wait for a response from the server in seconds).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcyMVJ1jsC5g5mLqqkoYN983zN9JyX3kpD_0NEhQYelKh8MYBtaPNVYjf6TW80ioeM9-8laaxAfO_4oJSbjs-8YiUl0MnTKlJ7bsVx7QMHpLQVDJ3Z6ndfVJBZGgEriR8yoCuz0MB12oSNt2-pUYYHOsAnB?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

17. **Block "Message Window"** shows the user a modal dialog window with a specified title, text, and set of buttons. The following properties are specified for this block:

* Message (a variable that will be displayed inside the dialog window, in this case: “Email sent”);
* Buttons (buttons that will be available for the user to click).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcoWiWykzd3lj2lHC7tNCaz8V16CNe8TGomc-mZ6dC22IA5njTj7KeR8gPtmGVnddyKL0RPmjzsa158iUfse0A6tq-nxkJB20EOmulcx9mXSfET28LOV2QtLEuuYdMl6b-C3Y3_Fpum4d6CeIOIvZJ1Rqo?key=2Kw34UXGjHk-7PKjgLzXFw" alt=""><figcaption></figcaption></figure>

18. **Block "Mouse Click"** emulates a mouse click on the reset button. This block was added using the user action recording tool.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/primery-robotov/calculator-action-triggers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
