# 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.

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. 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`.
   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.
   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.
   1. Have a browser window opened already. For this example, open a Google Chrome window.
   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 Google Chrome window.
   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.

  <iframe
    src="https://documentationpicturerepo.blob.core.windows.net/videos/Forms/open_hyperlinks_inside_form_video.mp4"
    title="Accelerate building automations with UiPath Integration Service"
    style={{
      position: "absolute",
      top: 0,
      left: 0,
      width: "100%",
      height: "100%",
      border: 0,
    }}
    loading="lazy"
    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
    referrerPolicy="strict-origin-when-cross-origin"
    allowFullScreen
  ></iframe>

## Sample workflow

To check the complete workflow or to have a future reference, download the [XAML example](https://documentationexamplerepo.blob.core.windows.net/examples/Forms/Open_Link_Inside_Form_Example.zip)
