activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

工作流活动

上次更新日期 2026年3月24日

打开表单中的超链接

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.

提示:

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.

教程

如要使用“按钮”(按钮)打开超链接,请执行以下操作:

  1. Add a Create Form activity into your workflow. Design the form according to your use case.
    1. 拖放类型为“单击”按钮组件,您将使用该组件打开超链接。在此示例中,将其命名为Visit our website and leave us feedback 。复制此“按钮”组件生成的字段键,或为其创建唯一的字段键。在此示例中,字段键visitOurWebsiteAndLeaveUsFeedback
    2. “选定的按钮”输出属性中,按键盘上的CTRL + k ,并创建一个名为selectedButtonString变量。此变量用于创建一个条件,在该条件下,仅在选择特定按钮时才会打开超链接。
  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. “条件”属性字段中,传递以下表达式: selectedButton = "theFieldKeyOfTheDesiredButtonComponent" 。在此示例中,传递selectedButton = "visitOurWebsiteAndLeaveUsFeedback"
  3. Add a Use Application/Browser activity inside the Then block of the If activity.
    1. 让浏览器窗口已经打开。对于此示例,我们将打开一个 Google Chrome 窗口。
    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. 转到“关闭”属性,然后从下拉列表中选择Never 。这会使窗口在执行其中的活动后不会关闭。
  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. 保存工作流并运行。

结果

单击 Visit our website and leave us feedback 按钮时,系统将打开一个新的 Google Chrome 窗口,提示您访问 https://google.com/ URL。

示例工作流

要查看完整的工作流或供日后参考,请下载XAML 示例

  • 教程
  • 示例工作流

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新