逻辑应用程序条件无法按预期工作 [英] Logic Apps condition does not work as expected

查看:87
本文介绍了逻辑应用程序条件无法按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了非常简单的条件,检查SQL返回值和输入值是否相同。

I create very very simple condition that check SQL return values and input value are same or not.

SQL返回值低于,输入值为'r13b00t1'。

SQL Return value is below and input value is 'r13b00t1'.

{"customer_code": "r13b00t1"}

Logic Apps条件由设计师创建

Logic Apps Condition is created by designer

"contains": ["@body('CustomerCodeAction')","@body('JSON_Parse')?['Customer_Value_data']"]

我相信病情不会失败,但总是失败。即使我直接输入字符串,结果也一样。

I believed the condition could not fail but it always failed. Even if I input the string directly, the result was the same.

如何获得预期结果?

推荐答案

不确定实际的身体输出是什么,但我尝试了显示的样本 下面,它对我有用。

Not sure what's the actual body output is but I tried with the sample shown  below and it worked for me.

代码视图:

{
    "definition": {
        "


schema":" https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
" actions":{
"条件":{
" actions":{
" Response":{
" inputs":{
"body":true,
"statusCode":200
},
"kind":"Http",
"runAfter":{ },
" type":" Response"
}
},
" else":{
" actions":{
" Response_2":{
" inputs": {
" body":false,
" statusCode":200
},
" kind":" Http",
" runAfter" :{},
" type":" Response"
}
}
},
" expression" ;: {
"和":[
{
" contains": [
" @triggerBody()",
" @variables('MyVariable')"
]
}
]
},
" runAfter":{
" Initialize_variable":[
" Succeeded"
]
},
" type":" if"
},
" Initialize_variable":{
" inputs":{
" variables":[
{
" name": "MyVariable",
" type":" String",
" value":" r13b00t1"
}
]
},
" runAfter":{},
" type":" InitializeVariable"
}
},
" contentVersion":" 1.0.0.0",
" outputs":{},
" parameters":{ },
" triggers":{
" manual":{
" inputs":{
" schema":{
" properties" :{
" customer_code":{
" type":" string"
}
},
" type":" object"
}
},
" kind":" Http",
" type":" Request"
}
}
}
}
schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", "actions": { "Condition": { "actions": { "Response": { "inputs": { "body": true, "statusCode": 200 }, "kind": "Http", "runAfter": {}, "type": "Response" } }, "else": { "actions": { "Response_2": { "inputs": { "body": false, "statusCode": 200 }, "kind": "Http", "runAfter": {}, "type": "Response" } } }, "expression": { "and": [ { "contains": [ "@triggerBody()", "@variables('MyVariable')" ] } ] }, "runAfter": { "Initialize_variable": [ "Succeeded" ] }, "type": "If" }, "Initialize_variable": { "inputs": { "variables": [ { "name": "MyVariable", "type": "String", "value": "r13b00t1" } ] }, "runAfter": {}, "type": "InitializeVariable" } }, "contentVersion": "1.0.0.0", "outputs": {}, "parameters": {}, "triggers": { "manual": { "inputs": { "schema": { "properties": { "customer_code": { "type": "string" } }, "type": "object" } }, "kind": "Http", "type": "Request" } } } }

如果这不起作用,请分享LA工作流程截图或代码视图供参考。

If this doesn't works , Please share you LA workflow screenshot or Code view for reference.


这篇关于逻辑应用程序条件无法按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆