logic app expression that evaluates to true if specific column of any row of an sql query result equals given value

Lior K 0 Reputation points
2023-03-21T16:19:48.5533333+00:00

I am writing a logic app and I need an expression that evaluates to true if a specific column of any of the rows of an sql query result equals a given value. Thanks!

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,083 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sonny Gillissen 3,351 Reputation points
    2023-03-28T12:49:32.52+00:00

    Hi Lior K

    Thanks for reaching out on Microsoft Q&A!

    I think the easiest - and most readable - way to do this in a Logic App is to make it a two-step process:

    1. First create a 'Filter' action where you add your array as input, and reference the column you want to check together with the value you want to check on
    2. Next create a 'Condition' action to check the records returned by the filter using the length() function

    Your Logic App will then look somewhat like this:

    User's image

    If the filter returned any rows, your column value matched the value you wanted to check for, thus the condition returns true because the number of rows returned by the filter is greater than 0.

    You can then use the 'True' section of your 'Condition' action to perform the actions you want to perform when the expression is true.

    Please let me know if this answer is helpful by clicking 'Accept answer' and upvote it.

    Feel free to drop additional queries in the comments below!

    Kind regards,

    Sonny

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.