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

Workflow Activities

Last updated Dec 20, 2024

Real Time Forms

This tutorial shows how to change values inside a form while the form is displaying. This can be achieved using the Continue workflow execution feature inside the Show Form activity, Form trigger activity, and the Get Form Values and Set Form Values activities.
This specific tutorial demonstrates how to display or auto-fill content inside a form, based on the values of other form components.
  1. Create the Main workflow. Add Show Form and a Run Local Triggers activity.
  2. Create a Form file that asks users for their consent to participate in a study. Name it as Study participation consent.
    1. Add a Radio component, asking the user if it wants to participate in the study.
      Remember the Property Name so you can retrieve the user's answer and then update the form data.
    2. Add a Radio component, asking the user if it's 18 or above.
      Remember the Property Name so you can retrieve the user's answer and then update the form data.
    3. Add two Label/Header components. One of them should display a message when the user wants to participate and is over 18 years old. The other component should display a message when the user wants to participate, but isn't over 18 years old.
    4. Add a Text Field component to ask for the user's full name.
    5. Add a Number component to ask for the user's age.
    6. Add a Text Field component to ask the city where the user lives.
    7. Add a Text Field component to auto-fill the district where the user lives in, based on the city it provided.
  3. Create a trigger workflow for the scenario where a user doesn't want to participate in the study (if user doesn't want to participate.xaml).
    1. Add a Form trigger activity for the Study participation consent form. As the event, choose when the first Radio component changes.
    2. Add a Get Form Values activity. Select the Study participation consent form. In the Arguments collection, add an entry for the first Radio component.
      For this example, add the following entry:
      KeyTypeValue
      wantToParticipate (the Property Name of the first Radio component) StringdesireToParticipate (global variable)
      With this activity you can learn if the user wants to participate in the study or not.
    3. Add an If activity, and set the condition if it's true that the user doesn't want to participate in the study.
      For this example, use the following condition: desireToParticipate = "no"
    4. In the Then block, add a Close Form activity and a Stop Local Triggers activity.
      This closes the form and then the automation if the user doesn't want to participate in the study.
  4. Create a trigger workflow to check if the user that wants to participate in the study, is 18 or above (check if user of legal age.xaml).
    1. Add a Form trigger activity for the Study participation consent form. As the event, choose when the second Radio component changes.
    2. Add a Get Form Values activity. Select the Study participation consent form. In the Arguments collection, add an entry for the second Radio component.
      For this example, add the following entry:
      KeyTypeValue
      areYou18OrAbove (the Property Name of the second Radio component) areYou18OrAboveofAge
    3. Add an If activity, and set the condition if it's true that the user is 18 or above.
      For this example, use the following condition: ofAge = "yes" And desireToParticipate = "yes"
    4. In the Then block, add a Set Form Values activity, where you pass in a custom message for the user, inside a Label/Headercomponent.
      For this example, add the following entry:
      KeyTypeValue
      over18 (the Property Name of a Lable/Header component) String"Awesome! Please fill in the rest of the form to enroll in the study."
    5. Similarly to the previous steps, add another If activity for the scenario when the user isn't 18 or above and can't fill in the form anymore.
      For this example, use the following condition: ofAge = "no" And desireToParticipate = "yes".
    6. In the Then block, add a Set Form Values activity where you display the custom message, then close the form and stop the automation.
  5. Create a trigger workflow to auto-fill the district where the user lives based on the city it inputs (auto fill city district.xaml).
    1. Add a Form trigger activity for the Study participation consent form. As the event, choose when the City component changes.
    2. Add a Get Form Values activity to get the city where the user lives in, using the following argument entry:
      KeyTypeValue
      city (the Property Name of the City component) StringuserCity
Check out the result of this tutorial in the video below:

Workflow example

To follow the steps and try out the tutorial yourself, check out the sample project here.

  • Workflow example

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.