activities
latest
false
UiPath logo, featuring letters U and I in white

Workflow Activities

Last updated Dec 20, 2024

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:

  1. From the Create Form activity > Properties panel, open the FormFieldsCollection window.
  2. Add an In argument of type String and name it suggestively.
  3. Open the Form Designer and drag an HTML Element component to your form.
  4. In the Display tab > HTML Tag field, add p for a new HTML paragraph.
  5. In the Content field, add the type of data that you want to pass dynamically by using the expression {{data.variable}}, and replace variable with the name of the argument created at Step 2.
  6. 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 :

  7. Convert the image to a Base64 string.
  8. Save the Base64 string as a workflow variable. For example, image.
  9. From the Create Form activity > Properties panel, open the FormFieldsCollection window.
  10. Add an In argument of type String and name it sampleImage.
  11. Set the Base64 string from Step 2 as Value.
  12. Click OK to close the FormFieldsCollection window.
  13. In the Form Designer > Advanced tab > HTML Element component > Content field , enter the following expression:

    <img href={{data.sampleImage}} height=100 width=100/><img href={{data.sampleImage}} height=100 width=100/>
    Note: The Label/Header basic components can also be used to pass elements dynamically. This enables you to set dynamic labels and headers for form fields.
  • Tutorial

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.