如何在Power Automate中获取当前URL并读取URL参数值?
在Power Automate中获取带参数的URL并提取参数值
第一步:在Power Apps中传递URL到Power Automate流
- 给提交按钮的
OnSelect属性设置如下公式(假设下拉框控件名为Dropdown_Server):
注:替换// 构造带参数的跳转URL Set(varTargetURL, "https://myformpath.example&serverName=" & Dropdown_Server.Selected.Value); // 跳转到目标URL Launch(varTargetURL); // 调用Power Automate流,传递完整URL YourFlowName.Run(varTargetURL);YourFlowName为你实际的流名称,Dropdown_Server为你的下拉框控件名。
第二步:在Power Automate中处理URL并提取参数
- 创建以Power Apps为触发源的流,添加一个文本类型的输入参数(比如命名为
ReceivedURL),用来接收Power Apps传递的URL。 - 添加Parse URL动作,在“URL”输入框中选择触发源的
ReceivedURL参数。 - 动作执行后,可直接通过表达式引用解析后的参数值,比如提取
serverName的值:
你可以把这个值保存到变量,或者直接用于后续的流操作。body('Parse_URL')?['queryParameters']?['serverName']
替代方案:直接在Power Apps中传递参数(更高效)
如果不需要传递完整URL,也可以直接把下拉框的选中值传给流,省去URL解析步骤:
- Power Apps按钮公式:
Set(varTargetURL, "https://myformpath.example&serverName=" & Dropdown_Server.Selected.Value); Launch(varTargetURL); YourFlowName.Run(Dropdown_Server.Selected.Value); - Power Automate流直接接收
serverName参数,无需解析URL,直接使用即可。
内容的提问来源于stack exchange,提问作者Antreas Apostolou
相关产品推荐
相关产品推荐

