[英]How to get query parameters in a Logic App?
I'm trying to pass an extra query parameter to Azure logic app so that I can process below data in the Logic App workflow我正在尝试将额外的查询参数传递给 Azure 逻辑应用程序,以便我可以处理逻辑应用程序工作流中的以下数据
For Example https://logicURL?SelectedData= "%7BsiteURL%3AXYZ.sharepoint.com%2Fsites%2FXYZDev%7D" (encoded string)例如https://logicURL?SelectedData= "%7BsiteURL%3AXYZ.sharepoint.com%2Fsites%2FXYZDev%7D"(编码字符串)
In HTTP action I am trying to handle above passed data with below JSON schema在 HTTP 操作中,我尝试使用以下 JSON 模式处理以上传递的数据
{
"kind": "Http",
"inputs": {
"schema": {
"properties": {
"selectedData": {
"type": "string"
}
},
"type": "object"
}
} }
I am not getting selectedData value.我没有得到 selectedData 值。 I need to use decodecomponentURI and then use the JSON value.
我需要使用 decodecomponentURI 然后使用 JSON 值。
Azure logic app schema Azure 逻辑应用架构
Find the error here在这里找到错误
First, you need to add your query param to the existing ones, eg首先,您需要将您的查询参数添加到现有的,例如
https://xyz.logic.azure.com:443/workflows/id/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=code&SelectedData="%7BsiteURL%3AXYZ.sharepoint.com%2Fsites%2FXYZDev%7D"
https://xyz.logic.azure.com:443/workflows/id/triggers/manual/paths/invoke
?api-version=2016-10-01
&sp=%2Ftriggers%2Fmanual%2Frun
&sv=1.0
&sig=code
&SelectedData="%7BsiteURL%3AXYZ.sharepoint.com%2Fsites%2FXYZDev%7D"
Then, you should be able to get them in your Logic App using然后,您应该能够在您的逻辑应用程序中使用
@triggerOutputs()['queries']['SelectedData']
As you can see, there is no need to add a schema to the Http Trigger to get a query parameter可以看到,不需要在Http Trigger中添加schema来获取查询参数
FirstName
LastName
and FaveColor
propertiesFirstName
LastName
和FaveColor
属性https://xyz.logic.azure.com:443/workflows/id/triggers/manual/paths/invoke ?api-version=2016-10-01 &sp=%2Ftriggers%2Fmanual%2Frun &sv=1.0 &sig=code &FirstName=Huomer &LastName=Huimpson &FaveColor=
triggerOutputs()['queries']['FirstName'] triggerOutputs()['queries']['LastName'] triggerOutputs()['queries']['FaveColor']
triggerOutputs()['queries']?['FirstName'] triggerOutputs()['queries']?['LastName'] triggerOutputs()['queries']?['FaveColor']
coalesce(triggerOutputs()['queries']?['FirstName'] , 'Puomer' ) coalesce(triggerOutputs()['queries']?['LastName'] , 'Puimpson' ) coalesce(triggerOutputs()['queries']?['FaveColor'] , 'Purple' )
## BEFORE @triggerOutputs()['queries']['SelectedData'] ## AFTER @{coalesce(triggerOutputs()['queries']?['SelectedData'] , '__blank__')}
@{}
syntax can be used if you are editing workflow definition language directly, but not if you are entering it in the "expression dialog box"@{}
语法,但如果您在“表达式对话框”中输入它,则不能使用I am sending query String as:我将查询字符串发送为:
https://prod-17.westindia.logic.azure.com:443/workflows/f3b63b086e61420e8d76b7478f4b3e39/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=nESqZWY2NyAKKhCkaM0VnfenHuTqi1NSBjJdl9M5jNA&UserName=SecretName&Password=Nikita@123 https://prod-17.westindia.logic.azure.com:443/workflows/f3b63b086e61420e8d76b7478f4b3e39/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%&Ftriggers=%2Ftriggers=1 nESqZWY2NyAKKhCkaM0VnfenHuTqi1NSBjJdl9M5jNA&UserName=SecretName&Password=Nikita@123
I want to extract UserName in logic app.我想在逻辑应用程序中提取用户名。 For that I have used Compose connector and use following statement in expression.
为此,我使用了 Compose 连接器并在表达式中使用了以下语句。
coalesce(triggerOutputs()['queries']?['UserName'] , ' blank ')合并(触发输出()['查询']?['用户名'],'空白')
I have tried this to:: triggerOutputs()['queries']?['UserName']我试过这个::triggerOutputs()['queries']?['UserName']
But I am getting one single blank space appended in front of UserName in output.但是我在输出中的 UserName 前面附加了一个空格。 Due to which, my condition is becoming false even if UserName is correct.
因此,即使 UserName 正确,我的条件也会变得错误。
How to remove this extra space which is unnecessary appending to front.如何删除不必要的附加到前面的额外空间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.