Reputation: 99
The following logic app is triggered at 10 AM and runs a SQL server query. As you can tell from the picture the resultsets are empty.
The conditional check checks whether the resultssets of the query is empty. (2nd pic)
How does this still translate into a True? The result is clearly empty.
Upvotes: 0
Views: 790
Reputation: 99
Anyway, I found another way. For future refence my solution was as follows:
"Compose": {
"inputs": "@empty(body('query')?['resultsets'])",
"runAfter": {
"query": [
"Succeeded"
]
},
"expression": {
"and": [
{
"equals": [
"@outputs('Compose')",
"@true"
]
}
]
}
Upvotes: 0
Reputation: 29492
With your condition, you are trying to compare an array to a boolean.
Instead you could check if the length of the array is not equal to 0:
{
"Condition": {
...
"expression": {
"and": [
{
"not": {
"equals": [
"@length(body('query')?['resultsets'])",
0
]
}
}
]
},
...
}
}
Upvotes: 2