# Create Enrollment Order

Let's consider an example of a robot designed for the automatic generation and printing of enrollment orders for students. The input data is a registry of students (participants of the training program). This process is often used in educational institutions and recruitment agencies.

The robot project consists of two diagrams and three files, one of which is in xlsx format, and the others are in docx format.

If we describe it step by step, this robot works as follows:

1. Loads the data table from the file "P1\_Training\_template.xlsx".
2. Iterates through the cells with the order number.
3. Proceeds to the scenario from the diagram “CreateEnrollmentOrder\_ProcessCreateWord”, which inputs the data, gets the date and time, converts them to text, and then inputs the data into "P1\_Enrollment Order Template.docx", sending it to print.
4. Fills out “Enrollment Order Template.docx", saves it, and prints it.

**Main Project Diagram**

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

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdPcwkCWPYMUfTMwBYwGZT-2G8lsrjeKsvCMAlbBE5BZLYHLPoUq0EMT_rINn-twLAV2tum0tp6DKDoxVO5N2g6f_QZ7DOSpTVpAOdubbT3VeSoB54sj0a6Pq0nJqtLAFgvMASU4C_jZtBYVLB5ijP5xLEP?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

1. **Block “Start”** (any diagram begins with 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 a header);
* Sheet (the ordinal number of the sheet from which data needs to be read into the Data Table).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcRYBZsTdSg9zUKoHktBFyKGXWw8NpklhqXUEbx2LPBEIJAtzSq0CfauvQR6YeNT4TOi0ul-CJpHcsSthnJnvOrJX-njg9IfS6HJVwIYYWLIDVIIoCB41gP5nmnpaGRxUwWWI096BFvS8PU-CPepqInn3tU?key=jnp0R80kKn84ibHDSqYCXA" 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_4nXdVPDsSXxFMhzYKTazSK7rm8YirEr8SlcD5RkghuvBzt0IKQeSTRgF8UDvd2w9gPJMT7_UfZiGFVzmA5HMckjUu4PAwMU8-64mq3_GGw2uK8Nm9zDgD8p_m20EooSkhTevK9RYGKsnWfqSvpHIVSPE-EcE?key=jnp0R80kKn84ibHDSqYCXA" 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).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXep74ybO3eOkTMAaDSWwHFkK7yh8CVL80sh5NBdBkjDmfQtQ-dDycC961JjPX_nsWyZXhoW5irSClPGAOLZ0E__zLoIFglFRp-3W8YbYqq_wsZVgY70fSUcyhY2AXJ1DaGpLrzhTWbCBQFLCsX6iRp9MAWN?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

5. **Block “Condition”** 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 variable $a is equal to “Hello”, then the exit is “Yes”, otherwise – the exit is “No”.

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

In this case, the condition is set as: -Not \[string]::IsNullOrEmpty($Row\[0]). That is, it checks that the value of the zero cell in this row is not empty.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXefMrdvPilTAKF_1pXT2tVhyHCo4Q1yVy3_us79DGuOEpxIqsy9J90JUbtW8mSrIEM_mq8JBeFTNOo5cabCqUKVFwB3nQ_1C1SnP3gUhLEyrykdaip9WebVKK-mNn-_cAYDjJnqMhbwDzJMN9RkBJNHFik?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

6. **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 three variables, respectively.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd95tMSnrAx-sMlmf-Wjwww2b7h709hcFwINub1KvJDrjppBKd_o_B3Vc3npEma38-f3oWczsVHzT-C9rSVJxlYqSnWzFL8DP548lHP0NKy5d6lPLTzx6K-BDjJOllfWuQprojGDSR0NNTbXaA6XODiiHVr?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

7. **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_4nXc1g5EblVGUnqE3LyxQ8ufT6cPJ-5kxGzO2rqEgLqgYcaDDsC_pswQ952qMHV9vcZUrrHnaXyS73ihOoPRKtw_T4992OnhOT7yHKxsmQhhs2pj2tolBD3kPwkFAZKRC2k9R4UWve3irfXUVXOmHASTeytMX?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

8. **Block “Execute PowerShell Expression”** starts the execution of one or more expressions in a language compatible with PowerShell. In this case, one expression is used: $ListFIO.Add($fio). It adds the value $fio to the list $ListFIO.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeY0X6NTGEmzh1WvxIZXnkKqKiNWGC59bbF6EsRaAP265vvxhctnv8JbufeJMa4xXsx2LxLVmf-0qapve5kOLBPWAjuI87gyyCV7EmjDiTT0cqpTIOXeRvLnTqL9FqDzXPoWMGP07MD1ywYpbHMey_IO5M?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

9. **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” 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.

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

10. and 11. **Block “End”** (this block concludes the execution of the scenario or returns the subprocess diagram to the main process).

**Diagram “CreateEnrollmentOrder\_ProcessCreateWord”**

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdss9_9I3JYyp_jKniHGke0hxHY8MFCG-0F8q7XNNCEmpycGGzM_QnEsBkIHTmpHV2isbRB0HJrfoff27E9_43KIW5TTdFNSGg_jqs7FbKnk9TlXqfVQknhNbRu3gcfCGNZsWQ3vpqZBeC5bTjjHuSvm9Ko?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

1. **Block “Start”** (any diagram begins with this block).
2. **Block “Loop”** allows repeating a chain of actions (blocks) several times while counting the number of iterations of the loop, recording the current count in a special variable (specified in the “Loop” property), which can then be used in other blocks. Upon first entering the block, the value of the variable from the “Loop” property is set to “Initial Value” (in this case, it is equal to 0), and then the execution of the scenario continues towards the “Loop” exit of this block (into the so-called “loop body”). As soon as the execution of the scenario reaches this block again, the value of the “Loop” variable will increase by the value of “Step” (in this case, it is equal to 1), and again there will be a transition to the “Loop” exit. As soon as the value of the “Loop” variable becomes greater than or equal to the “End Value” (in this case, it is set by the variable $ListFIO.Count), the execution of the scenario will continue towards the lower exit of the block. Don’t forget to connect the exit of the last block in the loop body to the entry of this block or any of the preceding blocks.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf3sdzcpZ4xW9MhN8QwdIPFJ4g_m18eTYF_N3vbJqf8IW3DBbxkY_TLBinORcrj-pKv_gSmYGQ5fVzO-GG6ZTcqyQFvaVIJ1owZATZ4Snq7ZGp6SiS6H2O67XMb00fbsKGBUkJv80BAd-XjHrgdhCey0_eE?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

3. **Block “Execute PowerShell Expression”** starts the execution of one or more expressions in a language compatible with PowerShell. In this case, one expression is used: $ListFIOString += ($Index+1).ToString() + ". " + $ListFIO\[$Index] + \[Environment]::NewLine. It adds a new line to the string in the format “1. Ivanov Ivan Ivanovich\r\n”.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfYJuG5b7yMBfr3MnSUIZI85JspoTD1TRFqIPfMCuNN1DS8CLH3xjmjiz0FJMTO6du6MO9FVGUWBqB_dUqI1J-VuHHRimcKSOLqPV_RUm6yKPEyxTaOSph-YP_i-0o76FfEfZIX-EeOxCp598pTO2FT0is?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

4. **Block “Get Current Date and Time”** allows obtaining the current date and time according to the user's computer settings. For this block, one property is specified – “Result” (returns the current date and time).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdN-4fj6g5t8oIGBhCfMWA2MmujLXcHLA3YvDFy2I5DFPds-co2C29Txy_CMxn-UPq2ji0nxhtNxHyYqXu1K_d1xW6n_ZmWVa0M5i9QgcHsHMMvXiZvja6ic1I-0GrKRxW5978wGtnnFZDfSF6GhaBzERE?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

5. **Block “Convert Date and Time to Text”** allows converting a variable of type “Date and Time” into text format. For this block, the following properties are specified:

* Value (the date and time that need to be converted to text);
* Format (the format for converting date and time to text).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcpnNukh9HdNn5HUHrJXQjmxMLxiUw-ST23C9fv53_ct70rJHZozyAVSbV4j6n0oCDArydDysGliEWlhcDqgAThw1i5rl9zFaU2sK4Zg0k0z-qUGSm_Q1h058i6o7Lm7gmrAhTEL7T_fcHqy4Pp3ha6Ij-Q?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

6. **Block “Get File Path”** retrieves the full path to the file with the specified name. For this block, one property “File Name” is specified (the file name along with its format).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfpyGtZKiU08PgCe3qP295c6TCrmT9-GW1xC7k4qBSbU944g4VT0cU14PGqbqW4gz7sffj-9fd-bSWMVEBKKNU_ESE_WENmPBbDXzyncFFVWzRq5id4n4MEo6hyf0Q8ySjuIwzBgLyDEAxLRmLXPjA-Z6_G?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

7. **Block “Open Document”** allows opening a Word document. For this block, the following properties are specified:

* 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_4nXflShroef1cY5801_AWfxc_zksmtDy5mG_AfdFOCaM2HSXFBKNHBRVCOjUAIc9b_7RKcWom_UAAQTkBkQZB6o3GDxAKMczFBpxGvULCqRWW7Tdub_-ZSWrN-cyTqOqx1B9UVSe4Dn2Mp-PF1_Xe4jK0RYV8?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

8. **Block “Replace All Variables in Text”** allows replacing all variables %variable% in the Word document. For this block, the following properties are specified:

* 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 “Link to Word” property of the "Create Document" or "Open Document" blocks from the Word group that were previously used to create or open this document);
* Link to Document (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 “Link to Document” property of the "Create Document" or "Open Document" blocks from the Word group that were previously used to create or open this document).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdsIihEOTKv7vTCdgouAmCIrx88pjqHdj9BW6Mjn5PyioqVhFAvStXSN13PHnD6wUTceMNURfE4qtfduiB178x5Z9pKL-59IbLi353a1MLLaJxHXELk2X3nzp8mfMDjj_C5Iz9_A9MGF_s2WgXUUBukVWUH?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

9. **Block “Get File Path”** retrieves the full path to the file with the specified name. For this block, one property “File Name” is specified (the file name along with its format).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdekXyta3MwjF99lU-6fMVJ2XQ-9VJQuWexED6iI5fylCOO1KQjNOeyWfu1C8iaL6uYRSJmbtkIwpZwW60-vLKv0DBgGKpqd9PBmaGiRrN7FuezWTyMmrjZeYmGS91pkgpXiRtB5GJ5AUvPuhcQkSlKCAhF?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

10. **Block “Save Document”** allows saving the Word document. For this block, the following properties are specified:

* 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 “Link to Word” property of the "Create Document" or "Open Document" blocks 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 “Link to Document” property of the "Create Document" or "Open Document" blocks 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_4nXc3ELM8kXdcL7ebcLxQ1lkjgNgvGTmAIisidIBwc7O6U-IJWQY-sF-f76wlcoMiT5yGb3tNvtARHSaUZt58SuPxk21jNGXS5EFi9HVjhHWiSsE1svEioEGG_mGJY8E13XTVRroBHYsnzbqgTuBRdGAgZD10?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

11. **Block “Print Document”** allows sending the Word document to print. For this block, the following properties are specified:

* 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 “Link to Word” property of the "Create Document" or "Open Document" blocks from the Word group that were previously used to create or open this document);
* Link to Document (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 “Link to Document” property of the "Create Document" or "Open Document" blocks from the Word group that were previously used to create or open this document).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXczuCO4EJ51TQUyB1exjkusI-x1BiMXPMjeoyPPuEyvFEf47KcQgwt_HlIAEDSKKrh16mZuucl0pa1BvB8s5S3aRIpr6dJqqZ2k6zimBSjV7e-qoUH3hl0ScTj-jdqsJ5-2qrXauaaQx1VGJgyxofgeyQ-Q?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

12. **Block “Close Document”** allows closing the Word document. For this block, the following properties are specified:

* 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 “Link to Word” property of the "Create Document" or "Open Document" blocks 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 “Link to Document” property of the "Create Document" or "Open Document" blocks from the Word group that were previously used to create or open this document).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc-tnPPCln3owM-eb58MEy1fo3q6F637kJOvxgx45pwwHyQZvEa5dmmGHRJBtTeSHHD7n66ANLmDohWMKxNwNvxlitQ83y_omYbY3sU8_k18WMVAjE5KO0cpW2_mSafU6GntJ88f8fZrYc2FN7pCsVTNIzz?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

13. **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” 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.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdR4h1HXcPWf0OeSeN3nUoLEgbeQLeRZko4X4wfPNA4Kw9DOotRS9VgF0PiLPgiFUlpT2w-Sy3N7htGH7p2F2lGmfhyxBlp1ZpwnKuXc4_8zh6rvNbGrpKxBFuiuEm5KR4x_0sHr-lSLf_5xhnfYUXJ_yo8?key=jnp0R80kKn84ibHDSqYCXA" alt=""><figcaption></figcaption></figure>

14. and 15. **Block “End”** (this block concludes 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/enroll-certificates/create-enrollment-order.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.
