Section | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Templates can have default values. The syntax is {<control name>=<default>} For example, this form also contains a control labeled "Total Items in Cart" which is named "T". A template {T=0} would resolve to the value "0" when the field named T is empty otherwise it would resolve to the entered value.
The Shopping Cart section control contains templates for its Label, Hint and Help.
The Help property contains this text:
...
Before the user starts entering values into this form they will see:
As a user begins entering values into the form fields, the templates will immediately begin appearing, and the user will see:
Templatized String Parameters
...
It is very useful to use templates with repeat controls. Imagine a long list of medications that appear on the form in a collapsed state. It is helpful if the section labels are not simply a static text such as "Medication" but rather dynamic and indicative of the values entered into the form.
Complex Templates for Workflow Routing and Escalations
Excerpt |
---|
When you are setting up step Assignments or Escalations for workflows, you can assign a user/role template where only part of the text is inside the curly brackets - {}. This is best explained with a simple example using roles for workflow routing. Let's say the roles in your organization are floor-manager, sales-manager and store-manager. Of course, these role names and users assigned these roles must exist in your tenant. Your form has a dropdown control named roles with these options: floor, sales, store. Users select the first part of the role from the dropdown. The suffix -manager is typed in after the role template in the Assignment tab to create the complex template - (floor-manager, sales-manager, store-manager). The workflow step with the complex template assigned will navigate to the appropriate role. A partial match template lookup is available on the Assignment and Escalations tabs to select the complex template from dropdown options. We will assign the {role}-manager on the Assignment tab of a workflow as an example:
The partial lookup works with users/roles and prefixes/suffixes in the users/role names. |
...
Let's say you have a radio control named Products in a form/workflow step. The options are Computers, Cell Phones, DVDs, TVS and Other. If Other is chosen, a comment field displays for additional information.
Use this syntax to access the selection control option and/or the selection control comment in a template. The examples use templates to specify the Task Information field on the Task List for a workflow:
- To access the value of the selected option via the template the syntax is - {your selection control name}
- To access the value of the selection control comment via the template the syntax is - {|your selection control name.comment}. The commentValue syntax in the template is also suppported i.e.{, |Products.commentValue} instead of {, |Products.comment}.
- To access the value of the selected control options in a repeat the syntax is - {the separator |your selection control name} - curly brace - the separator - space - pipe - your selection control name - curly brace.
- To access the value of the selected control comment fields in a repeat the syntax is - {the separator |your selection control name.comment} - curly brace - the separator - space - pipe - your selection control name.comment - curly brace.
Template Validation
...
A form or workflow that has a templatized property validation error will appear in the list of forms/workflow with a pink/salmon background. This warning is non-fatal and will still allow the form/workflow to run. These types of templatization errors are typically introduced by renaming or deleting a control that is the target of a template elsewhere, or by a typo in a template name.
- Any control that has a templatized property error will show an error message below it (red text on gold background).
- Within a workflow, any workflow step containing a control that has a validation error (for a templatized property) will be shown in pink when not selected.
- If there are form/workflow/workflow step templatized property validation errors present, then when the designer opens the corresponding properties dialog, all properties on all tabs are immediately validated. Any tab containing an error will be displayed in red text.
Note |
---|
Any templatized property that references a value to be supplied by _data (either the uploaded _data file or the _data url parameter) that is not also a control name will result in a non-fatal validation error. In this situation, the designer can either ignore the error or, if the validation is for a form/workflow or workflow step property that prevents saving the properties, add a hidden control of the same name so that validation passes. |
...