skip to Main Content

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.

enter image description here

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    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"
                            ]
                        }
                    ]
                }
    

  2. 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
                ]
              }
            }
          ]
        },
        ...
      }
    }
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search