Applies to version: 2023 R1 and above; author: Łukasz Maciaszkiewicz
Introduction
WEBCON BPS offers many useful functionalities, including HTML templates that allow you to generate PDF or HTML files and send custom e-mails. This article explains how to identify the item list and data table form fields using the GUID identifier in HTML templates used in the “Generate a PDF file”, “Generate an HTML printout”, and “Send a custom e-mail” actions.
GUID
The GUID number is an alphanumeric identifier of a configurable element, such as a form field, workflow, or process, whose value is constant and unique irrespective of the environment it is placed in. With those characteristics the GUID identifier enables easy transfer of HTML templates containing elements identified with it between various environments (DEV/TEST/PROD).
So far, the WEBCON BPS system allowed users to use the GUID identifier for identifying the data row form field in HTML templates. The 2023 R1 version expands this ability to include two new form fields: item list and data table.
The GUID identifier of the “Delivery address” form field
In WEBCON BPS the abovementioned HTML templates are used in the following three actions:
The “HTML template” admin action
The administrator can generate an HTML template that contains tags of individual form fields and their elements. Those tags can then be used to create your own HTML template.
To generate such a template, click the “Admin” icon → “Admin actions” → “HTML template” in Portal. Once the template is generated, it is saved on your hard drive.
The action generating an HTML template in Portal
The HTML template generated with the admin action contains tags of all form fields and their elements (the item list part of the template is captured in the red frame)
The abovementioned template is very useful for creating your own HTML templates, as it groups all the form field tags in one place and thus significantly reduces the time needed to look for them in the system.
GUID identifier in HTML template
The general rules for identifying item list, data table, and data row form fields in HTML templates using the GUID identifier are discussed below. Note that form fields of other types cannot be identified with the GUID identifier.
For all the three form fields, the GUID identifier is placed inside a dedicated tag referring to a specific element of a form field (header, row, footer). (The “GUID” text present in the below examples of code is replaced with the GUID identifier of a particular form field).
The item list forms a table that consists of a header, row, and footer. Each of those elements is identified with a dedicated tag within which the items placed under such element are inserted.
The HTML code in the header section should contain column names.
Code: {SUBELEMHEADERTEMPLATE:GUID} {/SUBELEMHEADERTEMPLATE}
The code of the row section must include tags referring to values of individual columns. The tags for particular columns are to be found in the HTML template generated in the Portal using the admin action.
Code: {SUBELEMROWTEMPLATE:GUID} {/SUBELEMROWTEMPLATE}
The footer code is optional and can contain items summing up the values in columns.
Code: {SUBELEMFOOTERTEMPLATE:GUID} {/SUBELEMFOOTERTEMPLATE}
An example of item list template:
<table>
{SUBELEMHEADERTEMPLATE:f1a398e9-ccf5-45c3-8943-b873f707bd0b}
<tr>
<td>ID</td>
<td>Name</td>
<td>Quantity</td>
<td>Unit price</td>
<td>Sum</td>
</tr>
{/SUBELEMHEADERTEMPLATE}
{SUBELEMROWTEMPLATE:f1a398e9-ccf5-45c3-8943-b873f707bd0b}
<tr>
<td>{DET_LP}</td>
<td>{DET_Att1}</td>
<td>{DET_Value2}</td>
<td>{DET_Value1}</td>
<td>{DET_Value3}</td>
</tr>
{/SUBELEMROWTEMPLATE}
{SUBELEMFOOTERTEMPLATE:f1a398e9-ccf5-45c3-8943-b873f707bd0b}
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>Total: {DET_Value3}</td>
</tr>
{/SUBELEMFOOTERTEMPLATE}
</table>
A PDF file generated from a template using the “Generate a PDF file” action
The PDF file generated from the user-created HTML template (item list placed inside a red frame)
Like the item list, the “Data table” form field has a header, row, and footer.
The HTML code in the header section should contain column names.
Code: {SQLGRIDHEADERTEMPLATE:GUID} {/SQLGRIDHEADERTEMPLATE}
The code of the row section must include tags referring to values of individual columns. The tags for particular columns are to be found in the HTML template generated in the Portal using the admin action.
Code: {SQLGRIDROWTEMPLATE:GUID} {/SQLGRIDROWTEMPLATE}
The footer code is optional and can contain items summing up the values in columns.
Code: {SQLGRIDFOOTERTEMPLATE:GUID} {/SQLGRIDFOOTERTEMPLATE}
An example of data table template:
<table>
{SQLGRIDHEADERTEMPLATE:c2499ebd-669f-4841-b1ff-b0660118e63a}
<tr>
<td>Name</td>
<td>Quantity</td>
<td>Unit price</td>
<td>Sum</td>
</tr>
{/SQLGRIDHEADERTEMPLATE}
{SQLGRIDROWTEMPLATE:c2499ebd-669f-4841-b1ff-b0660118e63a}
<tr>
<td>{DET_Att1}</td>
<td>{DET_Value2}</td>
<td>{DET_Value1}</td>
<td>{DET_Value3}</td>
</tr>
{/SQLGRIDROWTEMPLATE}
{SQLGRIDFOOTERTEMPLATE:c2499ebd-669f-4841-b1ff-b0660118e63a}
<tr>
<td></td>
<td></td>
<td></td>
<td>Total: {DET_Value3}</td>
</tr>
{/SQLGRIDFOOTERTEMPLATE}
</table>
A PDF file generated from a template using the “Generate a PDF file” action
The PDF file generated from the user-created HTML template (data table placed inside a red frame)
Unlike the abovementioned form fields, the “Data row” form field collects data only from one row defined by the user. In this case, apart from replacing the “GUID” text with the GUID identifier, it is also necessary to replace the “COLUMN” text with a tag of a column that includes the data to be displayed.
Code: {SQLSELECT:GUID:COLUMN}
NOTE: if you do not insert the column tag and insert only the GUID identifier, the eventual file will contain only the ID number of the data row.
An example of data row template:
{SQLSELECT:93732aa8-2c93-4c00-8db6-6293997a5694:DET_Att1}
A PDF file generated from a template using the “Generate a PDF file” action
The PDF file generated from the user-created HTML template (data table placed inside a red frame)
Summary
The method of identifying item list, data table, and data row form fields with the GUID identifier makes transferring HTML templates between different environments (DEV/TEST/PROD) much easier and ensures their consistency.
It is worth noting here that in order to ensure compatibility with earlier system versions the previous method of identifying the form fields in question, i.e. with the ID number, is still supported.