Activities
latest
false
Banner background image
Workflow Activities
Last updated Apr 22, 2024

Opening Hyperlinks Inside Form

This is a step-by-step tutorial that demonstrates how to open hyperlinks inside forms, using a Button component of type Click. The sample workflow consists of a generic form about customer satisfaction, that prompts users to visit a certain website before submitting the form.

Tip: Starting from this tutorial, you can also create a table of hyperlinks inside a form, using a Data Grid component. You populate a Data Grid with Button components, and using the SelectedButton output property, you can create conditions under which a certain URL is opened in the browser.

Tutorial

To open a hyperlink using a Button:

  1. Add a Create Form activity into your workflow. Design the form according to your use case.

    1.1. Drag and drop a Button component of type Click, that you will use to open the hyperlink with. For this example, name it Visit our website and leave us feedback. Copy the generated Field Key of this Button component or create a unique Field Key for it. For this example, the Field Key is visitOurWebsiteAndLeaveUsFeedback.
    1.2. In the SelectedButton output property, press CTRL + k on your keyboard and create a String variable named selectedButton. This variable is used to create a condition under which the hyperlink opens only when a certain button is selected.
  2. Add an If activity inside the Do block of the Create Form activity. This activity is meant to condition the hyperlink to open only when a specified button is clicked. This prevents the hyperlink to open when clicking the Submit button.
    2.1. In the Condition property field, pass the following expression: selectedButton = "theFieldKeyOfTheDesiredButtonComponent". For this example, pass the selectedButton = "visitOurWebsiteAndLeaveUsFeedback".
  3. Add a Use Application/Browser activity inside the Then block of the If activity.

    3.1. Have a browser window opened already. For this example, open a Google Chrome window.

    3.2. Click Indicate application to automate (I) and indicate the browser that you want to use for opening the hyperlink, by clicking it. For this example, indicate the Goggle Chrome window.

    3.3. Go to the Close property and choose Never from the drop-down list. This makes the window not to close after executing the activities inside of it.
  4. Add a Go To URL activity inside the Do block of the Use Application/Browser activity.
  5. In the URL property field, input the hyperlink that you want the button to open. For this example, input "https://google.com/".
  6. Drag and drop a Log Message activity into the Sequence workflow. Set the Log level to Info and print out the selectedButton variable in the Message field. For this example, pass the following expression: "This is the button that the user clicked: " + selectedButton.
  7. Save the workflow and run it.

Result

When you click the Visit our website and leave us feedback button, a new Google Chrome window will open, prompting you to the https://google.com/ URL.

Sample workflow

To check the complete workflow or to have a future reference, download the XAML example

  • Tutorial
  • Sample workflow

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.