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):

  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.

  1. Block "For Each (Data Table)" iterates through all rows of the data table.
  1. 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).
  1. 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).
  1. Block "End" (this block completes the execution of the scenario or returns the subprocess diagram to the main process).

Diagram "EliseyProjectBeidgi"

  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.
  1. 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.
  1. 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).
  1. Block "For Each (Data Table)" iterates through all rows of the data table.
  1. 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.
  1. 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).
  1. 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.
  1. 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).
  1. 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).
  1. 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).
  1. Block "End" (this block completes the execution of the scenario or returns the subprocess diagram to the main process).

Diagram "EliseyProjectCertificate"

  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.
  1. 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.
  1. 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).
  1. 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).
  1. 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.
  1. 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).
  1. 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).
  1. 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).
  1. 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.
  1. and 12. Block "End" (this block completes the execution of the scenario or returns the subprocess diagram to the main process).