# 1C Incoming Invoice (COM)

Let's consider an example of a robot that creates an incoming invoice in the 1C program. The source data for this project is the file "Supplier Order". The work is based on using a COM connection to the 1C application.

This project demonstrates loading data from PDF or Excel. To see how the work with PDF occurs, you need to connect the "Start Process" block and the left block "Get File Path".

To check the work with loading from an Excel file, you need to connect the "Start Process" block and the right block "Get File Path".

The robot project consists of four diagrams and four files: two txt, pdf, and xlsx. The file "QueryTemplate.txt" contains a query template written in the 1C language. There is a separate diagram for loading data from pdf and xlsx files.

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

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfLBcTTuQY38aEScNqWYbpFlfS2xSieVBDUWoosMOlVid2SQMwb6y5RxxhTe3_Lofh90PypYxOgqfI4VL5KmuHQqt7v7LB7KOSaz7nHl-0Cqh0BNZYoPwin9zxdg6vX6KUSMZnGACnVmWSWeeYVN_kyyxU?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

1. **"Start" Block** (any diagram starts from this block).
2. **"Get File Path" Block** retrieves the full path to the file with the specified name. The following properties are specified for these blocks:

* Folder Path (the path to the folder where the required file is located; if the property is empty, the folder where this project is located will be taken);
* File Name (the name of the file along with its format).

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

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc9yQrdCV-rqmCckZtnwukbXxTeuVnUJtVnbSeTJuUUsG0yOf43xuFATv6XeVZJA1th2bqop-P9is5GUlqdg2V4jPEHSvDxkZUoHYDPIcLppTKX7AgBTAmuhAvGqDD9CbAuVM9VL4JHZz4yN5flWzaTj3c?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

In this case, two "Get File Path" blocks are used in parallel: one for the pdf file format, the other for the xlsx file format.

3. **"Process" Block** allows creating scenarios consisting of several 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 as soon as the "End" block is reached in the external diagram. For the "Process" block, the property "Diagram Name" is specified (the name of the diagram file where the scenario will continue execution).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeyQi9MuRkhL4xyvtCScZLRoXiMtAvHsOkcaSJcbpZBPzzq5FGzeQ10s5UAwySWqgj8kiE172E6qn5sFyK-fnO-i22J-G3McKD4YYpB4P_CSRhW9Lp_afCi5b6NJqWB6qD99_b-Eszw20JUqlQ-591HUvc3?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXctDC-aNiA3ARKEtMBYQWQb6MNDMH6qfA2SvQ3VrwFaU9fX_nSCh033en2T08o1BGEe48yxO4L0L00qFUWCvZLbeIYAbVM3kaPTjwff5-kf6T3CzSjs23XA9U3OsQCcQoAUp7e666NT89feMT4MMwKP71Fj?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

In this case, as above, two "Process" blocks are used in parallel: one for loading data from the pdf file, the other for loading data from the xlsx file.

4. **"Process" Block** located below allows creating another scenario that is common for the two scenarios described above. This process is responsible for adding the invoice to 1C. For the "Process" block, the property "Diagram Name" is also specified (the name of the diagram file where the scenario will continue execution).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfhMQY1TX2cZSVm6rCk3h3E4CPJTUXz_9dZ_23jXcsGI02HNCp7eMlDZWw64-cQxxBU9_Y-Erg5Nrv1FPjCO6-q8NTvKUQ3DsbmVUFIpbKagFvAhqOK4wlZ-9SUx-mx04zNzhWu2nuAE7FhH4APukmQqOiT?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

**Diagram "LoadDataFromPDF"**

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcuES4FWujD3zcHdFQUnHBxO0mfErb99NUog0SZ10Uj6OwVWiIbcTuEX-owTegXQvzEswReKl6Sm6EdQbxZZ5SjQpeWdcnc7D5aRc8vKraxYutFiD3SRsVhUlsmyq7BZbPHO7lTJFQi-dK9lV-snVLYAwvN?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf6LvuEmiRZXB1_rm7mz3CyKIGAtuJkR0dehfjuOZUbV30TuZO7SUuyGFXbbD_bmun1eJa0wG_RMcyZ9_xhICWTfKKRQcV5mm_YvdJGNGSy8qLv8w1JAr3mvD2Qqkq2PYkrxITO-mw3tZpg7EDq4WZd-e-P?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

1. **"Start" Block** (any diagram starts from this block).
2. **"Log" Block** allows outputting arbitrary messages and/or variable values to the log during the robot's scenario execution. For this block, the property "Value" is specified. The text constant is indicated in quotes, and the variable name starts with the $ symbol. That is, this block records a message in the robot's log about loading the selected file specified by the variable.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfzhOXtJn5wicT1dCYx6BiE2GWiVlv4wQoNi2R8kkGZy4mlmuFEYKKSAqy-rT9II5IT0E2AyOhlm7tr1IKKrKfjj0M5WIVVvpxAzeUVs7T0KAUJ5Hr3qKcdUkG6sJ5QYINoNB-chIaIYzZwtO-4e7ys66Wz?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

3. **"Execute Expression" Block** starts the execution of one or more expressions in a language compatible with PowerShell. In this case, two expressions are used.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeIu9PCfpmpnNtn53nmUxjJacER2ZzSBTznv4XvjpgkhDVmL3W2ZURsuNtECrWw4rZ3kWmpkD2EBvglmHcjJ6B1MhXHlYLgjO_3Y3fJTfKaGRXmpt8XWwLTk-2zp82ToNsl3akm40Joao1vaabB0I6TD89D?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

4. **"Extract Table" Block** allows extracting the specified table from a pdf file. The following properties are specified for this block:

* File Name;
* Page Number (the page number from which the text will be extracted from the table);
* Table Number on the Page (the table number on the page from which the text needs to be extracted).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcx9l6BJoK4OOO6_5rSB1-PPLnmeveQ466MULnFSHcKvmOlLdGwfMlqEYUBlUQBTbl6hUH32LM6Ivp1p0tYLM2AHsWn5vtJqE2rMuRut4nmm-9bHTYxOkyvlk5UN8ypiPrfJROuwbv8fX81LwOiX0Ijcu1F?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

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

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

6. **"Get Text from Page" Block** allows reading text from the specified page of the pdf file. The following properties are specified for this block:

* File Name;
* Page Number (the page number from which the text will be extracted);
* Result (returns the extracted text from the page).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd5I5sTRCKGlP39gXHKIa-s4cu1w1GLX5ywbRmUnEfu_RkHZ4tbaeJejT5mPdDGl-siSUwyXQRxywzvT1H2jhhEukM6tHwIsPxDUQcZMoGzhfJQz7wpsz3wI3vM8n8Ba7-vSQqsJmRqAPSPQC1efIr1w7i2?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

7. **"Find Substring Between Two Substrings" Block** allows finding a substring in the text that is located between two other substrings. There should be as many of these blocks as there are substrings to find. In this case, two "Find Substring Between Two Substrings" blocks are used: for the substring "Executor" and the substring "Order". The properties of the blocks specify:

* Text (input string);
* Left Part (left search substring);
* Right Part (right search substring).

<br>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdbgtFp9b_Qkbrxe8dmeiQJelJd1i5DEORG5oXQCU-raN_eVtlmzQSo2WtQ3diDkDcBVHgkvHaZgNeTv5NSbFglLE7i0RS8B6bEiAKOIlbltsCd4xo_oGvt0q30MDfawZ5-g5RHdAZlbR7GwMkiRxfrPzU?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiTYPXBys14G89f77i5Mz22f4ezrRbbCAb1GSs41ueZMv1z-OQMLW9vAzu_VVe9xL57bH6N6Hwf9LCgzUfGsYwm59u-PspCrterejKwS0jVhn59ukD5TcTXMIx7PIFgwsmVwCkh5cVjlgVjneuwwnTQ8B3?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

8. **"Condition" Block** checks the specified condition for truth, after which the execution of the scenario continues towards the "Yes" exit (if the condition is met) or towards the "No" exit (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 "Yes" exit, otherwise – the "No" exit.

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

In this case, the condition is set as: $Row\[0] == $index, that is, if the value of cell 0 is equal to the variable $index, then the "Yes" exit, otherwise – the "No" exit.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfSmVqBFTPXu-1VNCWzm4bv9h3FrYZqNaAZ8DVNs5oOo5O6o-lFH4-VZD83aMCNhlYFnhnfpnX3pRN9hvHLA9mEc_HROI-FNgOW6RhqZDMpyDxiTRfWdP-gODe4clZf2_eUG8D-cnEf5wajhAUf0ufdyb7f?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

9. **"Add Row" Block** allows adding a row to the data table. In this case, the following properties are specified:

* Table (the data table to which the row is added);
* Row Number (returns the number of the added row, numbering starts from 0).

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

10. **"Write Value to Cell" Block** allows writing a value to a cell in the data table. In this case, three such blocks are used for different variables: $Row\[2], $Row\[3], and $Row\[5].

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXxeKROc_Q85uXzRVCh6ozR7cwHgtxq0i1_pkf-r3UOJi32naEI5kEGorkzvtdf5u2RAqSL4x1c4jgAV8puqlBqC21bL9YBUag2nLHpd8-zWZ2z_pxju7zO4qYGkcT1_snbSjqSRODnJrVVtSPmtcLGX-SzGo?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcgAmY-7jm8PD-n8wxkpRvzHI9ajAB8bDsPWl2F2miTCIcKwSv1K-fm4on_M3Es0WSBF9ony3SvFdza0kJSzzUp0E81jgbxsyGiDiIaEl7c0ACrojwF9H1HTkMfzSrWpsF4h5QKxVCovUXMKz8QtULtMxri?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdgVfkKqLgDOj52EBMgCXK5LNMznLwHYJuF-DcndwG_9P6iG37nj3Ks2mNlRh6XbMtsYRqjfn62-TAwW0mvotaxniCciK6IXMiMVw_aGgbB0HhSwC6HGlAR_qR3oWaLMTCyNkfC6IUCDfG-07jwAculfFoX?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

11. **"Execute Expression" Block** starts 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_4nXeHCutTccXGf8PfsB68ssGTAwAQKXo4wroHS5KS3pfnDxg1YxkVFmrzcYwuuWtKTc9DmvIdU-sO0eBytHL8bo7QzXEJ-12tkNMYh_txfu26JnwS-2eQl40fvICdb6c2AVW1zJ2RFFA1C3k8gUSgPyMTkuef?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

12. **"Execute Expression" Block** starts 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_4nXep-n0rhOQvCPWgs-uLuesS0v99taziW754WxbVvaeHnMI17YT5G-hw_hwbdMeS6rmZCnY5tRmEXeu0Xa-eAYqeDsvE9Yim1gAvkNshIEl7fO0rz3idj1hqMaDdGlE-4bAMSnjUsKAEam331GDV6jB_px6c?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

13. **"End" Block** (this block ends the execution of the scenario or returns the subprocess diagram to the main process).<br>

**Diagram "LoadDataFromXLSX"**

<br>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfJxv4Vr23qYtg-VbPmLFiBBQ2_1IydYgGq5f2fa4r-4pUjDDi6Io1qn9rpjLX7oqSBrC1E1M1-9ngncUkyjKDZodbbQZfZbyBilcBO7RdX433k6GxmJkzEyfD7KUYzlwfRb7mgbZIhQC0Zr9JxVhKXeI7I?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcRvfwTKFl41tXxn-x_-b9-_ZiJVHGsHFoWn7_VLEI0Sb8otrd7mpGoPkd_w7i8LxvjDrp3kJ4_HsqIyw3tcu0NB_PsTmRt0gQps2ABx0Fp-iymboNpSTJpa34yQKhSd7qfjKMvC7j26a5sNMLYz2V71IUv?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

1. **"Start" Block** (any diagram starts from this block).
2. **"Log" Block** allows outputting arbitrary messages and/or variable values to the log during the robot's scenario execution. For this block, the property "Value" is specified. The text constant is indicated in quotes, and the variable name starts with the $ symbol. That is, this block records a message in the robot's log about loading the selected file specified by the variable.

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

3. **"Open Document" Block** allows opening an Excel document. The following properties are specified for this block:

* File Path (the path to the Excel document that needs to be opened);
* Excel Reference (returns a reference to the process of handling the Excel document);
* Document Reference (returns a reference to the opened Excel document that is currently being worked on).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXduxJ0pc55wJKwsallTwe_scXHclp8HzactgtjnvgTfDDefZkMwN3YcOWaqVVCdSy6WhoWBlz5-fYzWasRElHKwbubwIGC-jgh2WvKCJEV-Zv22yzBd_MtgSW0nss9stsOuQmqVJ-tz5kIQZKt0h3cDmBF9?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

4. **"Get Cell Value" Block** allows reading a value from a cell in the Excel document. In this case, two "Get Cell Value" blocks are used for different rows and columns. The following properties are specified for this block:

* Document Reference (returns a reference to the opened Excel document that is currently being worked on);
* Sheet (the ordinal number or name of the sheet where the required cell is located);
* Row (the row number where the required cell is located);
* Column (the column number where the required cell is located);
* Result (returns the content of the cell of the same data type as in the Excel document).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdfTxNOAfolCxVq9Mst_jE6C1x03rhvzG5_MV81tbFFpgYLbEQYe3CL-kWlINkNLONv7-vfMk3aSx9Bh7us24zrxuUpK5y6OFr4mHcM6D_pamcXt1VDiRZZwwEs9RvZJL73ylweS3dcV-yHNIALnrRyRdzM?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdSN1-r6X1KOi_1LUOUvRBsLrSboIa2bZjHM8_ExvqoRasBQ5YAF1f0cmrH-NQGtE2zZ6kIBy_H9la5hsBt3a7WWYq3HGwW0BZSjl-wvhbPHZzk9cCXbogwkMyPfrFemjJVoFLZ7OSHssxsIt4sjrg0DgLR?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

5. **"Find Substring Between Two Substrings" Block** allows finding a substring in the text that is located between two other substrings. There should be as many of these blocks as there are substrings to find. In this case, two "Find Substring Between Two Substrings" blocks are used: for the substring "Executor" and the substring "Order". The properties of the blocks specify:

* Text (input string);
* Left Part (left search substring);
* Right Part (right search substring).

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

6. **"Execute Expression" Block** starts 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_4nXfehzKigJlW9Wefv3M2B-t5VRqR-jGm_sKDCQAe4Zn4Vsto53XUXsFNuI-_9hbtefUFQoD9K_hnplyyMmqDxiBjNfJpF1yh66-z_17qPQO1PtgM9VGnaL1HMQn1pf3D1Oomf-gez8OFeWmK4B11V0-pGRiZ?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

7. **"Get Cell Value" Block** allows reading a value from a cell in the Excel document. The following properties are specified for this block:

* Document Reference (returns a reference to the opened Excel document that is currently being worked on);
* Sheet (the ordinal number or name of the sheet where the required cell is located);
* Row (the row number where the required cell is located);
* Column (the column number where the required cell is located);
* Result (returns the content of the cell of the same data type as in the Excel document).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdAOgNaSJPHoyUNLv-LGRDl0ViOv6hZdlrpiY8c0Kh0C_eOp9GeoWhiGA6MTWs3_sPOjN8Lagel24Ey18kaOQY45E1aKW81zzq2AdVcEOOJLthrxL6qXd370dhL7zrrHguYXHOJmuT1qeicj-chEO9ZzSw6?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

8. **"Condition" Block** checks the specified condition for truth, after which the execution of the scenario continues towards the "Yes" exit (if the condition is met) or towards the "No" exit (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 "Yes" exit, otherwise – the "No" exit.

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

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdoV1g2m_cg2tuChMDI8BBa__qoYklCh6I8jiZmNRUx3chxPF7BTauQwcxFIfSA7-M3Y2u69SGFBnbWZO9oqsMoIi83m0g-Rk4hu39n4PLeNMu781FOWefVWe2Y_NXDb6qp73fbpJx8sX52iMiZmBmZgRS8?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

9. **"Close Document" Block** allows closing the Excel document. The following properties are specified for this block:

* Excel Reference (returns a reference to the process of handling the Excel document);
* Document Reference (returns a reference to the opened Excel document that is currently being worked on).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXftbROezdVCuz-ImOxJXPqT9inySBfHTIomTHyQc7WnCpY57MD9Cb9c2gE1M8S8LG-E8ZR7bfw4nVgGxFQDib3fRWfPJUE1HXVh6BhDCPiY7xFUJwW_5iEkQk5iEy13vzm63sD4aotBWSS7MKB0-GQXCivC?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

10. **"Get Cell Value" Blocks** allow reading a value from a cell in the Excel document. In this case, two "Get Cell Value" blocks are used for different rows and columns. The following properties are specified for this block:

* Document Reference (returns a reference to the opened Excel document that is currently being worked on);
* Sheet (the ordinal number or name of the sheet where the required cell is located);
* Row (the row number where the required cell is located);
* Column (the column number where the required cell is located);
* Result (returns the content of the cell of the same data type as in the Excel document).

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

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXelxe8VcJXU1fqw08k_jCdBgxzAeYhx-_cx33OZIQhTSRVUyCt3lpWNabeY9dGrHgrYZlp0rqnBJUSOGvK8yuw0Zf1p80e9ogpm2IJx3biJw28CxcWYuWtiO6oc092VocAx3ZEpoM5LH-P9ja8LryK5tEY?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

11. **"Add Row" Block** allows adding a row to the data table. The following properties are specified for this block:

* Table (the data table to which the row is added);
* Row Number (returns the number of the added row).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcndOxoWNRKoMjjgj6e-oVm_KKlKVT1jEn85VxJJUhbZ115fAmdQOtTvwS3_aP1aUXYOQvcQ1oaIZMrc7PkUzzuWelIgsxnTpqBXu0jBlgRP1lB3G3dTaVu1cDix8SRrQ0VzGnbQTR9EDpbQEblayin-60?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<br>

12. **"Write Value to Cell" Block** allows writing a value to a cell in the data table. In this case, three such blocks are used for different columns and values. The following properties are specified for this block:

* Table (the data table where the value needs to be written);
* Row (row number);
* Column (column number, numbering starts from 0);
* Value (the value that needs to be written).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe-EKG7FW78MfTk-SogdfFz8aNrjbtMrwOHK_IlZLRL0NzbqSKdXS-IVNWJhpNUT4BOAjYvDVJB2KhJzmHmGi1Iswtiu9URFovnBYf7YrqhsmY7TuJTPg92Wv9IzGnTspbgvFjyEytJLWBf2l-12SPmhzVs?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcnJi1Rf7K1vavXHJskUwpcBX9BKCqKlFbZznkSqpwuyAqf-wT32or_KmdljjA1duyAbg5-IjLv1PivKH7nyVJkIrs8tZ-GktnvuVnhekltWc0kw7FZejYWtF-Bm1UDbDfIboXr1L5oUiefZUwN4kvjexS2?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

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

13. **"Execute Expression" Block** starts 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_4nXcSOSM_wgT-jAnSxTWCZNAnF49PKP-kZBcA8WXt7jqirNT9y1PekwIqBRBIjzavTJhnlALHdzhiIh0JTFL-JwRs099dXjQI3iU9xrEWnZcVNX4z4qxuWaROkZxH_v38nHwUkTJuLUiMpdCTZ_DM30lEzStP?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

14. **"End" Block** (this block ends the execution of the scenario or returns the subprocess diagram to the main process).

**Diagram "AddingInvoice"**<br>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeV-3lEIEF2fmmSTpKd2k7TvFBDDe43xw_cyl9GQtrKlVjqB4-dRbIYMwyNqojgs-LTsYcXEy83_ez6bcXWEXn3S9t-InCOB9YhiN37GOORX90fwTxTYDgHp2ehTx5arraD9S4lDejTo4fdD5-OScXrYwc?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdcDTnTsqju9HzjYC5uhdfZtVviqoed6Nv1VP5bFf2vVGi9VvdofIDVTzdZmq__arDQTP2ehOcf87-8MQUsWTTIAb7A31w_bHoUEliF7KF2NkUuz7igFV-A5Ahs1jH3cUQljEMWU5s68npzpq2_1tPYrgjl?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

1. **"Start" Block** (any diagram starts from this block).
2. **"Log" Block** allows outputting arbitrary messages and/or variable values to the log during the robot's scenario execution. For this block, the property "Value" is specified. Here, this block records a message in the robot's log "Adding invoice".

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeOh4gf5sxDwQ1FodfLGuGkCMWMJ5yaCsQ9TKJ4MKl71-ChzIbsJmQcm87Yt2pFDiz15B5jrMPr4JquSfN5DKQ4rZvPZFI-ghjTwPMt7-aXq6_RP2EwKOFn6nEoCesRgaPLt4prP4gjKHP9zS05uUS7Recv?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

3. **"Read File" Block** allows reading the contents of a text file into a variable. The following properties are specified for this block:

* File Name (the name of the text file whose contents need to be read);
* Encoding (the encoding of the file);
* Result (returns the contents of the file).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe2uV5GwVZeb1MCsfsZgPwOflxwZ9WFX9XDRfje7DAPxOM7kr4QifuG86OYkoH1De66akoYPX1tuUcipumHuc34W7CwTm5-gtl7yRUS2tdeaH9BdbZDtXdcx5FooPBsl3r2OmFY2K9XlWKel7bLTL-jGy5t?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

4. **"Replace Substring" Block** allows replacing one substring with another in the text. In this case, two "Replace Substring" blocks are used: for "Customer" and for "Supplier". The following properties are specified for these blocks:

* Text (input string);
* Search Substring (the string that needs to be replaced);
* Inserted Substring (the string to replace all occurrences of the search substring);
* Result (the new string in which all occurrences of the specified string are replaced with another specified string).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdqC6tctyJgpUVPl7hWjqJjYtZEfcsUYHsknrRvx1wf5doM2w4nQI7BW8rOfTgtV3UuYxo841DekqnFN-ykMczRUFBCCSsOZesMnOgqJVr5WmashaDesDKkDeZZAo76YMY58f-SRJIgSH0Xvz4T_axZ-inc?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcTqKPg7nZUlXxc8Tf6yKYI_sA5U9EuJWTCQ6q0XWi8FJtvTlx12-aChSe_fHQGK0a3r5pwL-auMCd_R5o0ZRVlyCDNbxZbEouiXF42D4ZXg1gBVMacQyrYqfzGzUCbhynqpbz5z503CjFTmZrkE75vZfia?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd8jMl6RryCC21eViiAQOXdSD2JqcrQk6E4DuA4Q-1X3WtlGUQ3Phrikdq8UHMT38C2Vk3-34jBkRgDGe0zPmZjMR8p28DMGaBG072JKTGqQP8vGFXmcXtEw3cEnxjDIryQRJz5cKg7vcy5p8Xk_7ZNJaRJ?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

6. **"Join Text" Block** allows joining all elements of strings, placing a specified separator between them. The following properties are specified for this block:

* List of Text Parts (a list of strings that need to be joined into a text string);
* Separator (the text used as a separator);
* New Line (a set flag that includes a function where a new line will be used as a separator);
* Result (the resulting string).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfAHUtB1-AtMPrrC_JSq3Unb4dDNLmQ7nXLHbsY847KCTF6OEwTPJYoSsXaqOWqXBtTURtAKFdoyszCBJKggTY2ECyziirbIdKToDFNVmBVRrrKEGu2XUl_EvoAsBNTIgUIBK6WRA6B37cf50-jR5fVjJYl?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

7. **"Replace Substring" Block** allows replacing one substring with another in the text. The following properties are specified for this block:

* Text (input string);
* Search Substring (the string that needs to be replaced);
* Inserted Substring (the string to replace all occurrences of the search substring);
* Result (the new string in which all occurrences of the specified string are replaced with another specified string).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcKWnIolmuZPnTVWs--DJrTchwN8xHpWDVlwDmYK2-oEJFzAy3BcmqAwD3Sc73wgVfAuBh-zP7PQyqe-5E7DwGZGITWyz1plwe-30Ths9Jf6IBOPnhi3cU5_ieb6YkwTcbLd1m0FuAqt-V4BJy2tIlJpTUQ?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

8. **"Connect" Block** allows creating a connection. The following properties are specified for this block:

* Connection String (the connection string to 1C);
* User (username for authorization);
* Password (password for authorization);
* Visibility (a set flag that enables the visibility of the 1C user window);
* Connection (returns the connection object to 1C).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeJhfQiA8peA1Di1xpc2sfyJbnA80tU3FLcW_Bo5jux-PWIDG-R2lae-nbss2xrDVbCP2WNyYBsMMUzGMWj01qztdfXzOVLbe1DTHLl8P0TDSPajynajJInEyZFe4JRwCP4HvlQn_FoVY-f929lN3VnjnhY?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

9. **"Execute Code" Block** allows executing code on the server. The following properties are specified for this block:

* Connection (the connection object to 1C);
* Query (the query executed in the 1C language).

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

10. **"Close Connection" Block** allows closing the connection to the 1C server. The property "Connection" (the connection object to 1C) is specified for this block.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXftbROezdVCuz-ImOxJXPqT9inySBfHTIomTHyQc7WnCpY57MD9Cb9c2gE1M8S8LG-E8ZR7bfw4nVgGxFQDib3fRWfPJUE1HXVh6BhDCPiY7xFUJwW_5iEkQk5iEy13vzm63sD4aotBWSS7MKB0-GQXCivC?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

11. **"Log" Block** allows outputting arbitrary messages and/or variable values to the log during the robot's scenario execution. For this block, the property "Value" is specified: $ErrorMassage. That is, the robot's log outputs an error message.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdj9-ug615cl0NMltomme0GA-g7bhFmiuGZkVHvIgNixrEVNAjhkPK_d90Nc28T1TR-CV05sV29uR3CjmjU-ngYrQlGGXQnH_8AsIQm4t8iQdlWd83J0IQL-dwfVtbbP3vzXkeSihVN3YHTR5KhgdPApTcj?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

12. **"Execute Expression" Block** starts the execution of one or more expressions in a language compatible with PowerShell. In this case, two expressions are used.

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

13. **"Add Element to List" Block** allows adding the specified element to the end of the list. The following properties are specified for this block:

* List (the list to which the new element needs to be added);
* Element (constant, variable, or result of calculations that need to be added to the list).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcUQimaAjFAqtldej5tL-MZSm2P5VIHsInKDYVQY43ffGUwvpJ5BrSzTzwsdhOPr1LYKgBjlTsqLiS8R8aeS-rwERbCGOV0PTOnD0ZcOPDrnAAUgbdGmkmBynfTQhbi3s-J49cUSkgt5QCpvIl0iV4TzSF3?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

14. **"Execute Expression" Block** starts the execution of one or more expressions in a language compatible with PowerShell. In this case, two expressions are used.

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

15. **"Add Element to List" Block** allows adding the specified element to the end of the list. The following properties are specified for this block:

* List (the list to which the new element needs to be added);
* Element (constant, variable, or result of calculations that need to be added to the list).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd4is6h11AjYHcEGVnYphIvZGb2ZaGlN5PisdWkJcsdPe0ZlTTXnyqYMCgSogiP7z4_R3YSjUfTZxXaVV3sEiXwx7-lPYUFKaJ-sVwlBN_FxY73mBD7rtT3AyPAwBUg9kl9oYNCMEp5ohuJ8caySezm3ITe?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

16. **"Execute Expression" Block** starts the execution of one or more expressions in a language compatible with PowerShell. In this case, two expressions are used.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfasqGK6ULu_-OUsDVXmbbap2IpJfIT2v2YwkmSY6Jb0v3TTzUJf-TSrMPcrBexKnkLt9KGlI4Ggv347tXQNwZtmmtCT24tDvlgod0-9ZbNXRLEhoULRzG2JngMF0mig8vv3ewvl8ITRvADZ6LuPS8bx9Y?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

17. **"Add Element to List" Block** allows adding the specified element to the end of the list. The following properties are specified for this block:

* List (the list to which the new element needs to be added);
* Element (constant, variable, or result of calculations that need to be added to the list).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd4is6h11AjYHcEGVnYphIvZGb2ZaGlN5PisdWkJcsdPe0ZlTTXnyqYMCgSogiP7z4_R3YSjUfTZxXaVV3sEiXwx7-lPYUFKaJ-sVwlBN_FxY73mBD7rtT3AyPAwBUg9kl9oYNCMEp5ohuJ8caySezm3ITe?key=bQm2vlFSc1CKSZLYW_fmrw" alt=""><figcaption></figcaption></figure>

18. and 19. **"End" Block** (this block ends the execution of 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/1s-prikhodnaya-nakladnaya-com.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.
