Dynamic HTML Elements
Dynamic HTML elements enable you to create HTML content that can be dynamically displayed or used in any part of the form while the form is open during runtime. For example, you can assign an image to appear dynamically after a drop down option has been selected, then prompt the user to type in the image item in a text field.
Tutorial
To pass a dynamic HTML element:
- From the Create Form activity > Properties panel, open the FormFieldsCollection window.
- Add an In argument of type
Stringand name it suggestively. - Open the Form Designer and drag an HTML Element component to your form.
- In the Display tab > HTML Tag field, add
pfor a new HTML paragraph. - In the Content field, add the type of data that you want to pass dynamically by using the expression
{{data.variable}}, and replacevariablewith the name of the argument created at Step 2. - Select the Refresh on Change checkbox.
note
To add an image in an HTML Element form field, the image has to be converted to Base64 format.
To pass an image as a dynamic HTML element :
- Convert the image to a Base64 string.
- Save the Base64 string as a workflow variable. For example,
image. - From the Create Form activity > Properties panel, open the FormFieldsCollection window.
- Add an In argument of type String and name it
sampleImage. - Set the Base64 string from Step 2 as Value.
- Click OK to close the FormFieldsCollection window.
- In the Form Designer > Advanced tab > HTML Element component > Content field , enter the following expression:
<img href={{data.sampleImage}} height=100 width=100/>noteThe Label/Header basic components can also be used to pass elements dynamically. This enables you to set dynamic labels and headers for form fields.