web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Validating Boolean val...
Power Automate
Unanswered

Validating Boolean value with condition fails

(0) ShareShare
ReportReport
Posted on by 15

Hi all,

I am building a flow where I am checking in my SQL database if a row is present or not, and I am having issues getting the Condition to state True.

 

If the Row is present in the SQL table, it should go to the "left" part of the condition (YES).

 

Here is my flow :

mdruedal_4-1620306830681.png

 

 

The left part in the Condition - Equals is right now this:

equals(outputs('Execute_a_SQL_query_(V2)_check_for_already_existing_row')?['body/resultsets/Table1'], bool(1))

 

Here is the result from the SQL query :

mdruedal_3-1620306756779.png

 

And the result from the Condition:

mdruedal_2-1620306554567.png

 

Can anyone point me in the right direction to what I am doing wrong ??

I am grateful of any help I can get 😄 

 

/Michael

Categories:
I have the same question (0)
  • VictorIvanidze Profile Picture
    13,058 on at
    Re: Validating Boolean value with condition fails

    Hi @mdruedal,

     

    simplify a bit. Place to the left part this:

    outputs('Execute_a_SQL_query_(V2)_check_for_already_existing_row')?['body/resultsets/Table1'] 

     

     

  • mdruedal Profile Picture
    15 on at
    Re: Validating Boolean value with condition fails

    Thanks for the suggestion, however this has the same result, The SQL query result is "true" but the result of the condition is "false"

     

    mdruedal_1-1620337339810.png

     

  • VictorIvanidze Profile Picture
    13,058 on at
    Re: Validating Boolean value with condition fails

    Try to use string true instead of function in the right part.

  • mdruedal Profile Picture
    15 on at
    Re: Validating Boolean value with condition fails

    still the same result :

     

    mdruedal_0-1620375406171.png

     

    mdruedal_1-1620375431792.png

     

  • mdruedal Profile Picture
    15 on at
    Re: Validating Boolean value with condition fails

    And Btw. this is my SQL Query : 

    SELECT CASE WHEN EXISTS (SELECT 1 FROM [dbo].[XYZ] WITH (NOLOCK) WHERE DATE='4-5-2021') THEN CAST (1 AS BIT) ELSE CAST (0 AS BIT) END

     

    I think this would result in a Boolean value, or am I mistaken ?

  • Verified answer
    mdruedal Profile Picture
    15 on at
    Re: Validating Boolean value with condition fails

    Ok, I Solved my problem by taking another approach and counting the rows instead, converting the count to an integer and then in the condition: if greater than 0 the row exists and the flow will terminate.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard