The HTML Doc From Template smart service is used to generate an HTML document that is populated with process data. It is found under Appian Smart Services > Document Generation. Double click the activity after dragging it onto the canvas in the desired location. The Configure HTML Doc From Template dialog box is displayed. Select from the tabs in this dialog box to configure the activity.
Category: Document Generation
Assignment Options: Always Unattended
This section contains tab configuration details specific to this smart service. For more information about common configurations see the Process Node Properties page.
The Setup Tab displays the primary property sheet used to configure the node.
Template: Select your template HTML file from Appian Document Management. To browse through Appian Document Management, click the Directory button. The
Choose a document dialog box is displayed. Select a document. (Only documents that have an .html or .htm extension are listed.) You can also type the name of the document.
The file encoding used is UTF-1. (Your HTML template files must be encoded in UTF-8, if Unicode is used for the file encoding.)
Sample HTML Template:
1 2 3 4 5 6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <BODY> ###Name### joined ###Department### on ###Date of Joining###. The employee's position is ###Position### and their supervisor is ###Supervisor###. </BODY> </HTML>
Once the template document is selected, the substitution grid is populated with the keys denoted with
### found within the template file.
Runtime Template (Optional) An expression that selects a document using a variable or a Constant. (You can create Constants that contain each desired template.) The substitution fields in the runtime template(s) must match those in the base template.
Destination: The place the generated document should be stored. You can either create a new document or update an existing document.
The substitution keys found in the template file are listed in the Find in template document column. In the Replace with column, enter the text to substitute in place of the key. You can type the value or use an expression. If the field is left blank, the key is removed (replaced with nothing).
Substituting potentially malicious values into a HTML template can result in cross site scripting vulnerabilities in the resulting document. If your substitution values are coming from an untrusted source (including your end users) you must escape or encode the substitution values before merging them with the template document.
If you've made changes to the template document, click Rescan Template on the toolbar. The template is then rescanned for substitution keys. Whenever the template path is changed, the specified document is also parsed for substitution keys. The smart service activity supports Unicode (UTF-8) templates and generates Unicode documents.
If the activity is run as a user who does not have adequate rights to the template document, the document that is to be replaced, or the folder where the new document is generated, an error message is sent to the process administrator and the task is paused.
The Data tab displays the node inputs and outputs for the smart service. You can add additional inputs and outputs, if needed.
The ID of the document that was created or replaced is returned by the node.
To retain the ID of the document so that it can be referenced elsewhere in the Process Model:
This smart service is unattended. A form cannot be used.
This smart service is always unattended. You can select whether this unattended activity runs as the user who initiated the process or as the person who published the Process Model.
On This Page