I'm trying to do something very simple in Logic Apps: I want to check whether a variable equals a given string, I'm using this expression but it always gives me False
{
"name": "task_name",
"type": "string",
"value": "MyTask"
}
{
"name": "equalsVar",
type": "Boolean",
"value": "@equals(variables('task_name'),'MyTask')"
}
equalsVar
is always False, please explain where I'm doing something wrong
There seems to be no problem with this expression, please check if there is a problem with your azure logic app
design.
You can refer to this logic app code in logic app code view
:
{
"definition": {
"$schema": "<your-schema>",
"actions": {
"Initialize_variable": {
"inputs": {
"variables": [
{
"name": "task_name",
"type": "string",
"value": "MyTask"
}
]
},
"runAfter": {},
"type": "InitializeVariable"
},
"Initialize_variable_2": {
"inputs": {
"variables": [
{
"name": "equalsVar",
"type": "Boolean",
"value": "@equals(variables('task_name'),'MyTask')"
}
]
},
"runAfter": {
"Initialize_variable": [
"Succeeded"
]
},
"type": "InitializeVariable"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {}
}
Or you can refer to this design in logic app designer
:
My test defininition looks like this:
Could you please give me a screenshot of the
logic app designer
.It seems that your type is missing a
"
I dont know what was wrong in the initial state, but now it's working.. 🤷♂️