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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / IF condition returns f...
Power Automate
Answered

IF condition returns false when true expected

(0) ShareShare
ReportReport
Posted on by 9

First time poster and a newcomer to Power Automate but come from a programming background.

 

I'm building a flow to validate and update information in a Sharepoint list - it's for logging and tracking the progress of Asset Purchase Requests but that's largely irrelevant.  Inside the flow is a condition check to make sure all the information needed to advance the status to Requisitioned is present.  If this fails a string of errors is built up to provide the reasons for failure to the user in an email.  The check on the supplier variable is returning a false when it should be true.  My diagnosis is as follows:

 

1. Supplier variable initialised:

Supp var.png

 
 

This is set further on in the flow after Get Item retrieves the Sharepoint List item the flow is running on and an optional input at the beginning of the Flow using Input boxes in the triggering event (For a Selected Item)

Set Supplier.png

 

It is possible for the supplier to be left empty although this causes the validation on the item to fail (legitimately) here:

Validation.png

 

A variable storing all the possible errors is appended to in order to provide feedback to the user about the reasons for the flow failing. In the following, a check on the Supplier variable is made (NB: In this example the Cost price is also 0 so it fails for multiple reasons):

Supp Check.png

However, when I run the flow despite the Supplier variable being set to Null (here we can see it being set by the flow.)

RunSet Supp.png

When the check is made to fill the error message it doesn’t recognise the variable as being set to null and therefore doesn’t populate the error message string variable.

Error Supp.png

The Supplier variable is empty yet the IF supplier = null condition returns false. Help! What am I missing here?

 

Categories:
I have the same question (0)
  • Verified answer
    JonnyMain Profile Picture
    9 on at

    Update on this:  I found a workaround.

     

    Instead of checking the value of the variable I can write an expression using the empty() function

    SolutionSupp.png

    So the above expression reads as:

    empty(variables('Supplier')) is equal to true.

     

     

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard