# Print Certificates and Badges

Let's consider an example of a robot that prints badges and certificates based on an input template.

The robot project consists of three diagrams and six files. To describe it step by step, this robot works as follows:

1. Loads the Data Table from the file "Input Template.xlsx".
2. Iterates through the rows of the Data Table.
3. In a loop for each row, the robot calls the diagram "EliseyProjectCertificate" to print the certificate.
4. Then it calls the diagram "EliseyProjectBeidgi" to print the badges.

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

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

1. **Block "Start"** (any diagram starts from this block).
2. **Block "Load Data Table"** allows loading the "Data Table" from an Excel document. The following properties are specified for this block:

* File path (the path to the Excel document from which information needs to be loaded into the Data Table);
* Header (if the flag is set, the first row will be used as the header);
* Sheet (the ordinal number of the sheet from which data needs to be read into the Data Table).

The output is the Data Table, into which data from the Excel document will be loaded.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeFqGkTbm-KKLKIDHTEwLaoukkY9aac2HX3RCkOcPmL4WpKaC2mtkJl-lIxyE9jBDS5BWXKL6POfsdXnOG0TC9g2udyIdGB6EDpmSs2ZBsUUDqAn53ALKRbFbYVDV3lA1MKGkHG?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc8t9WIr0RRtUkGC6gsg3b7TZJ4Jj_d_eZn9tdHGBp8cKUrlyL2JIwfB5ItZRDlTGeoTmYwbOWuB9yc3j4UinlABkT4yhcxPnB23ZwA5cGyIuV-Qkr5TED7Z-1PSrtFLR2pvEOC?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

4. **Block "Process"** 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 in the external diagram is reached. 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_4nXeC8KZod_sAAnfrydoZ-rezCGknPSw3B5BMpT9O_W5sZCKgM_3ofCE2qkFkTp3vpFP90Nlx3rZdxxVPr-rcwgtetKf3kzFwLqSoKgr_a9KrjDO2trjpSeoC_uwOS3RSRjWreYKKsg?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

5. **Block "Process"** 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 in the external diagram is reached. 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_4nXd53wCZvaU3MZPOs7OWk5oknG8BrzTSX6WXw-rFcXksCjGPrChYfu-IVqQsoMqRy1y7qxO67ktlP_wyEPH_cEK0WMOWx71U1OYjtJyADC2cSeEfwwdPCy5sKJrDTfOScyw8lO4JlQ?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

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

**Diagram "EliseyProjectBeidgi"**

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

1. **Block "Start"** (any diagram starts from this block).
2. **Block "Assign Variable Value"** sets new values for one or more variables. In this case, one value is specified in the properties to be assigned to one variable, respectively.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfWFpMlhbCgkmO5XvSH7VfUoWbNj5Ob1iV7NOdDL3akzot4sIhPcf-oGS5MteNkO2jnLY432ZKbpcPbg1Mv1ZZriDtgYRV8sozillVkalJu_5wTScM-wEO_Q158EAn7PuLz5hujXA?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

3. **Block "Get Path"** allows obtaining the full path to the file. For this block, the name of the file for which the path needs to be obtained is specified.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfM9FDUzUYtmU1a2QEcYkZVYBziOJZc0pTelzai3OSWIYYCE72wktFLqs2J75EvYPiJ2LWRtDZCmK-SNdVUL-VDT5ifOE7RLyNsv2JDMdFu-xYtP2g_mQQkT-5mHbw1QIU4HGAMeQ?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

4. **Block "Open Document"** allows opening a Word document. The following properties are specified for this block:

* Use COM (if the flag is set, work will be done using the installed Word);
* File path (the path to the Word file that needs to be opened).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXftorcshY4vCjXz-VGJDxHErGbNhfXTR6p2xlIviA2hhlfDgcf9SeiqA5189BROy-XCKnOC4JHboG_phGNNKeLmeOYbJxyKaX60NA7JMx0tTbqK7ysQztxyfPOOy9JUCcj235ecYQ?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

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

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

6. **Block "Assign Variable Value"** sets new values for one or more variables. In this case, three values are specified in the properties to be assigned to three variables, respectively.

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

7. **Block "Replace Text"** allows replacing text in a Word document. The following properties are specified for this block:

* Link to Word (link to the process of handling the Word document, the name of the variable in this property must match the name of the variable in the property "Link to Word", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* Link to Document (link to the document that needs to be saved. The name of the variable in this property must match the name of the variable in the property "Link to Document", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* Search text (the text that needs to be attempted to find in the document);
* New text (the text that needs to be inserted into the document instead of the found fragment).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfCsZNVU4yNtJOzQCkVSDJI_5iyNjXt9qtJ-VeSFGDp5az-pfzUpvSFIOQbGtqEP5GcEwsjeZ0TI8_wgiXdQV7uYliBkZ3VN6m-vsjaxE8MEx27xForleD7ZqBi-mpT-Y7bP8R4?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

8. **Block "Get Path"** allows obtaining the full path to the file. For this block, the name of the file for which the path needs to be obtained is specified.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfu6DUd0bocBelQnHJGz4jz4UZ1co79We3C6joh8KL4FESWmxHacNwMHm2n6xBLZknNqBg-_isaVmQO_9dA7B3ktLuTNqPanOIXBYpUJiXK-_tN5uyQiupRyAEVfYGyde9y8xEnNw?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

9. **Block "Save Document"** allows saving a Word document. The following properties are specified for this block:

* Link to Word (link to the process of handling the Word document, the name of the variable in this property must match the name of the variable in the property "Link to Word", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* Link to Document (link to the document that needs to be saved. The name of the variable in this property must match the name of the variable in the property "Link to Document", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* File path (the path to the Word document).

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

10. **Block "Print Document"** allows sending a Word document to print. The following properties are specified for this block:

* Link to Word (link to the process of handling the Word document. The name of the variable in this property must match the name of the variable in the property "Link to Word", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* Link to Document (link to the open Word document, in which work is currently being done. The name of the variable in this property must match the name of the variable in the property "Link to Document", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document).

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

11. **Block "Close Document"** allows closing a Word document. The following properties are specified for this block:

* Link to Word (link to the process of handling the Word document. The name of the variable in this property must match the name of the variable in the property "Link to Word", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* Link to Document (link to the document that needs to be closed. The name of the variable in this property must match the name of the variable in the property "Link to Document", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdP35mqMcT6IpQMHlMqidr-dXtTCw0vrMLKwROBUE8hdWnxlxJFICJL6jn-z6Dm3hoAr5Cf-JPgv4neaXn8fKEJ0Ukt0OF6GjBz_UtY2jEqXv2dP2E-9yuOuc9hGgPyPb5UzqFS8g?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

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

**Diagram "EliseyProjectCertificate"**

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

1. **Block "Start"** (any diagram starts from this block).
2. **Block "Assign Variable Value"** sets new values for one or more variables. In this case, two values are specified in the properties to be assigned to two variables, respectively.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXetIeW9Z4ZfbP-8EUe6Iy5WRRoG0jpEd2PiLBgA8515egHSuuxm76xkDqiBvluR5dIJ3EZhFc-V64UwjehRc15eia3_zsW6Pi6LS_KATygLnKi5phmQ0uMscFuYxh7pCq-Uwf2h?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

3. **Block "Get Path"** allows obtaining the full path to the file. For this block, the name of the file for which the path needs to be obtained is specified.

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

4. **Block "Open Document"** allows opening a Word document. The following properties are specified for this block:

* Use COM (if the flag is set, work will be done using the installed Word);
* File path (the path to the Word file that needs to be opened).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcnj6v9-f7GvtjcoVgcTvqTXaxoVUhQYDpYezWmNIwLkdzmcOfAusJqjUAYG0SVTShhhmGib2gGPQYTtdfNGSj0KAS84D_ZL5q9gA-W_2Xml8gDuUGLSwYNpA6HyDhEcNp_n-7xLw?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

5. **Block "Replace All Variables in Text"** allows replacing all variables %variable% in the Word document. The following properties are specified for this block:

* Link to Word (link to the process of handling the Word document. The name of the variable in this property must match the name of the variable in the property "Link to Word", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* Link to Document (link to the open Word document, in which work is currently being done. The name of the variable in this property must match the name of the variable in the property "Link to Document", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdH5jF_AmH4XhfuoMv1XU9JO57PjfU1DO4NVWKWm8-P977bq3xM4wBccpZQJGyhDlh00vZlpnIrKX3o8Sgkax0txK19kaNH2PFLC1OQIvuz4_QNW7OxmsIiv1TcQ5z-dwbMQMg-cg?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

6. **Block "Get Path"** allows obtaining the full path to the file. For this block, the name of the file for which the path needs to be obtained is specified.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfd5NzSOBEfmuBAGYcyT4ZcYE4qssN8BRvfrvXRCSAcx-9Bt9EMMAoNrHO-dLRIsajNVSXNbzLCLpgordcsXZK_wOP_n6TptDW3roYfaeEv4PkMJ5osUmwMzJ9OU6FHm_xMKkLA?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

7. **Block "Save Document"** allows saving a Word document. The following properties are specified for this block:

* Link to Word (link to the process of handling the Word document, the name of the variable in this property must match the name of the variable in the property "Link to Word", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* Link to Document (link to the document that needs to be saved. The name of the variable in this property must match the name of the variable in the property "Link to Document", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* File path (the path to the Word document).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXde8cU6XszcBtUB5YdXVm21s6dOQUs-GSc4dkCf2NcZfz98W-M-R58hZbpaB3CJZXSZTDNgypNAfAaON5fTLDGyS6_o3VUwm8REwsodFX9EZnHmecyVGTQtZnf7F2a3Aj0fUAVy?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

8. **Block "Print Document"** allows sending a Word document to print. The following properties are specified for this block:

* Link to Word (link to the process of handling the Word document. The name of the variable in this property must match the name of the variable in the property "Link to Word", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* Link to Document (link to the open Word document, in which work is currently being done. The name of the variable in this property must match the name of the variable in the property "Link to Document", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe2z8awCFcrP_-j5zBFD1t98-NY1YWnpl28fHJeLUX9QSUqZQssTUvwiRC3POhzX2VCHdXpi3u3SC-AF-jnoan4Z09KFP31L7zUT8gyFTNt6OvWmYcXVayxyUjTD0KpEsgshZh7mw?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

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

* Link to Word (link to the process of handling the Word document. The name of the variable in this property must match the name of the variable in the property "Link to Word", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document);
* Link to Document (link to the document that needs to be closed. The name of the variable in this property must match the name of the variable in the property "Link to Document", blocks "Create Document" or "Open Document" from the Word group that were previously used to create or open this document).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdOLA-sUo2yCIH6bbQWp1UgUa3gRPPKmpmwVs1_iTbAHImWefFzW-VyTcwocG6Ka0X_cSSu_ZNd_mx1UvrQN2o8Pd-5Y1C9_e7r74l1P7C-6HV_1BdVQYy7-lnbss3S5DDY1CpEw?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

10. **Block "Log"** allows outputting arbitrary messages and/or variable values to the log during the execution of the robot's scenario. For this block, the property "Value" is specified. A text constant is indicated in quotes, and the variable name starts with the symbol $. That is, this block logs an error message in the robot's log.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdbOw0fQeZWq79yaZW6gvd6zxI3IdHdPO6R-G8VElETCtfmqKq0YWyczpnOGdHmcdT1v4UL7AyPMzbXltW5KVCG-nVgM0vfiU8Qq_lWMTOBiilow0c0JMKDX4vPCJw-b5mden5pGw?key=fPRZ_305HGkjDd2DbCIswH7E" alt=""><figcaption></figcaption></figure>

11. and 12. **Block "End"** (this block completes 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/print-certificates-and-badges.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.
