# Actions. Part 2 - Creating an Incoming Invoice

This robot example is the second part of a project that demonstrates working with Actions in the Orchestrator ([the first part here](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/primery-robotov/actions/actions.-chast-1-raspoznavanie-prikhodnoi-nakladnoi)) and shows how Actions work in the Orchestrator, which can be viewed [here](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-orchestrator/rabota-v-sherpa-orchestrator/ekrany/deistviya/primer-sozdaniya-deistviya-i-ego-nastroiki). At this stage, the robot receives a task from the queue ($QueueGuid) with the tag "1CModified" ($TaskTag).

This tag appears on the task after saving the form to save Actions in the Orchestrator. The result of this robot's work will be the verification and, if necessary, correction of the "Incoming Invoice" data after its recognition from a PDF file.

After receiving the task, data is entered into the already open 1C "Management of a Small Firm Training (Demo)".

The second part of the robot project consists of two diagrams.

Thus, if described step by step, this robot works as follows:

1. Receives a task from the specified queue that was added at the previous stage of the project.
2. Changes the status of the received task to "In Progress".
3. Launches the diagram "AddInvoice".
4. After executing the invoice addition scenario, changes the status of the completed task to "Successful".

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

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdpuFckPoa_h0RF3Nwuy59XMvjq63jnWra8fxMmN6nUkEjJimy3jwTJ9PPK4_Eo-vsXln_ZIKsQl5If2ZfaKSno9NSwImDkyj71gDZUcZcD406TaC1QKSQ_2dmLHq787k2aoiF38KFxZtT8vQ_LU4GDwiY?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

1. **Block "Start"** (any diagram begins with this block).
2. **Block "Get Task from Queue"** retrieves a task from the specified queue. The following properties are specified for this block:

* GUID/Name of the queue (GUID of the queue in the Orchestrator from which the task needs to be retrieved);
* Task status (task filter by status);
* Task priority (filter by task priority);
* Tag filter (filter by tags);
* Overwrite parameter object;
* Error when no tasks are available.

The following properties are obtained as output:

* Task GUID (returns the task GUID);\
  Name (returns the task name);
* Parameters (returns the task parameters);
* Task object.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfdCv2J5OXk0FopX839HcdQHo8GsDey0Q_Frl41SV3UUZkLOpzN50CQIsmAVtxgqeylXl7_AE7SXwxAJ4TQSN3t2J-9Y8lROCFaPhlciLHPRoOnA8Vu44_3Wg33f1pebActOqU7Ht9NKWGSTBBPndbNNKg?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

3. **Block "Assign Value to Variable"** sets new values for one or more variables. In this case, three values are specified in the properties that need to be assigned to the variables: the values of the cells "Goods", "Supplier", and "Order". Variables 1, 2, and 3 are assigned Values 1, 2, and 3, respectively.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfCgGz_sZ6mAzGCY98qtfPITSF7HbEL64vLXZCaTsoGI9EkwIBQqenik8ov6heOVNxGJs39UdmF4dvjbE_Zt4k43IdNXG2FqC_b59_FOCVM-2UYKJNUCXkzmC72fnwEuGkpy97hMCsT__cJJs0ed2x9tOcU?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

4. **Block "Modify Task"** allows changing the status of the task from the current one to "In Progress". The following properties are specified for this block:

* GUID/Name of the task (GUID of the task whose status needs to be changed);
* Status (the status that needs to be assigned to the task).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdm4XDW8FZIyCMdEXEY7PlgDwwB4kI6u3W01BEBGtghKree5qp1U3hLf6W2n1sRJV0KyrUjIhsAmhVhzLUEWsL4wL-jVGTUQunWODatNwlzcBG8J0QcFA1BbfG_oUcXVgaEoIfr8ojlprgePScNfZf9oE4X?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

5. **Block "Process"** allows creating scenarios consisting of multiple diagrams. The execution of the scenario will continue from the "Start" block of the specified project diagram. The execution of the scenario will return to the current block and continue in the current diagram once the "End" block in the external diagram is reached. For the "Process" block, the property "Diagram Name" is specified (the name of the file of the diagram where the scenario execution will continue).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdtUisGpTa53r8qH0AZIn3UIzHqIZy33uXx-kXsEz2YDnjNgPtAT5OF1UxaC3tyByNtpxR8qgRwg9AcmbJRgK3sGx0dew-rFA9oXnX3EEor3mjwx1jtI6T0QPAREjJHBPwCZTN4Hj39ghw9PC-CWDihfXnY?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

6. **Block "Modify Task"** allows changing the status from the current one to "Successful". The following properties are specified for this block:

* GUID/Name of the task (GUID of the task whose status needs to be changed);
* Status (the status that needs to be assigned to the task).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf38ccGc9p47n0caA8_nRCqyu1igzI4wBvMZfJ4FcI0_v3lORV5tzmFOerRUPfymqxLqIrxzA6qIAv9yRP0ksWZ8cbLo5VyeLOkDHV85UV6YMkxLrRyry4zIQAToF1VNvk60ndnhLR0BOYw9D4-kXvL30sr?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

7. **Block "End"** (this block completes the scenario or returns the subprocess diagram to the main process).

Diagram "AddInvoice"

After extracting data from the PDF file in the first stage of the project, the robot creates an invoice. This diagram was partially created using the "Record" function of Sherpa Designer. More details about it can be found [here](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/rabota-v-sherpa-designer/osnovnoe-menyu/panel-razrabotka/menyu-zapis/zapis-deistvii-polzovatelya).

Let's take a closer look at the blocks of this diagram (for convenience, the blocks are numbered):

<br>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdT3pT4lwpYgT0vKJDJt_LVnX61ro5c0MGyq5vsNxt8R7tDX_IBXNp1u2VvpaE6l0aBR0IsKbwov6qR73KauZOE6SSA_DLg4lcgWt9rDSIWDZKX6eWhacmN2X7xnCEh1ValEydEWNQSJ7MIyN2lZWpqtuyI?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeBxxFSGaJOQ3ZyccBxzRahBDVwI-a71qdhgvS0fbKcO9RQ3tdnYvGde0Wof5WwBeV0YGV9rg2EQe0TJzDI5f0XtkofhbPvs0o-AFUvFp9qN5m2XYI3tMB-7poLQzCy1VAcIzw3STk5_Ikkp7TR2IqK_TII?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

1. **Block "Start"** (any diagram begins with this block).
2. **Block "Log"** allows outputting arbitrary messages and/or variable values to the log during the robot's scenario execution. For this block, the property "Value" and the message level when sending the log to the Orchestrator are specified. Here, this block logs the message "Creating nomenclature".

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfEKLNl1aFhe_fE9VoZu_dPMssJuwVMPpmkdFIv3Wl0QFP33wErEyffnW0aWBmE_ozxZsqhNMctmmn4mfZiSEWC5WeIzrnaXg3YjekHR-ndh_yq3rVp-Qbp4hhZuKGlL3600H8rIIsF5bw3Dzfh0i6bIeU5?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

3. **Blocks "Check for Element"** (checks for the presence of a specified user interface element on the screen), "Click Mouse" (performs a click on the specified application element), "Press Keys" (emulates key presses on the keyboard), and "\[ENTER]" (emulates pressing the "Enter" key on the keyboard) have been added to the diagram using the "Record" function. Each of the blocks uses a selector. More details on working with selectors can be found [here](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/rabota-v-sherpa-designer/paneli-svoistv-i-peremennykh-i-rabota-s-nimi/panel-svoistv/nastroika-selektorov).
4. **Block "Assign Value to Variable"** sets new values for one or more variables. In this case, one value is specified in the properties that needs to be assigned to a specific variable.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdNMH_qeKxHKl5eYJYCQC0gPfh5Rue3yB92gqTacwop4mm6QeNv1x95MtJXyy-2xj7su41Yc7CP75voEeF0VTAxIDhGm-SoQJpshDNmwOUmVHnCv4vIt02XNTbrf2BjxqxId7-KUnI847J-wGIGvgfS_QM?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

5. **Block "For Each Loop (Data Table)"** iterates through all rows of the data table.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc9hYsfjAErrPFQkuBzLTvontKeeYP2yZQGj7QKRYffPu-LJ7bpU_W1GTPTmPn8p3uheJNhrPcuvR-zjp34AGOGS18hx7YXUkHjFABlii9Wr_Je916lRBYJGq_uISlal-0WDuW7I7liYIn_8oOOeR1XOjY?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

6. **Block "Click Mouse"** (performs a click on the specified application element) has been added to the diagram using the "Record" function.
7. **Block "Pause"** suspends the execution of the scenario for a specified time. The following properties are specified for this block:

* Unit of measurement (the unit of measurement in which the duration of the pause is specified);
* Duration (the number of seconds for which the scenario execution will be paused).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdd7iUAj3SeSM0s2ZuUyTQpkA1GvXqkOkoNlZic3X4k_itqaqQ4qaai53-A2bo_eD8tFCtaItO6xoX110nr08D_NQBem-RLqOAxGjGYvy_sEMPMuhOGQyu4GNjuN9ZOG9BcvHbwBbRRacWLSGOBD-LZ9z4U?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

8. **Blocks "Click Mouse"** (performs a click on the specified application element), **"Press Keys"** (emulates key presses on the keyboard), and "\[ENTER]" (emulates pressing the "Enter" key on the keyboard) have been added to the diagram using the "Record" function. Each of the blocks uses a selector.
9. **Block "Execute Expression"** initiates the execution of one or more expressions in a language compatible with PowerShell. In this case, one expression is used.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcDjI2KviWrJ25OtT-3HZAYiyItaJNnttBRzQN6TBQmfL5vlntLohBpimE4NELiEEg_GQxfYPC-YawGO5Hau9uX2oGxX3KXbdJtXYOKd2keZbCdCzO0xJdWM0OSQxbSsiNrAp5VfzjPtrPGTFObABGGypsH?key=AUJ9n9XuDPP2hhhE8Kng6Q" alt=""><figcaption></figcaption></figure>

10. **Block "End"** (this block completes the scenario or returns the subprocess diagram to the main process).


---

# 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/actions/actions.-chast-2-zavedenie-prikhodnoi-nakladnoi.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.
