cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mdruedal
Frequent Visitor

Validating Boolean value with condition fails

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

1 ACCEPTED SOLUTION

Accepted Solutions
mdruedal
Frequent Visitor

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.

View solution in original post

6 REPLIES 6
VictorIvanidze
Memorable Member
Memorable Member

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'] 

 

 

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

 

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

still the same result :

 

mdruedal_0-1620375406171.png

 

mdruedal_1-1620375431792.png

 

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 ?

mdruedal
Frequent Visitor

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.

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (101,772)