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 / How to check the value...
Power Automate
Suggested Answer

How to check the value of a Sharepoint Yes/No field in a switch condition?

(5) ShareShare
ReportReport
Posted on by

I swear Microsoft is making things super difficult for super basic things.

 

Why is it so hard to check the value of a sharepoint Yes/No column in a flow? I checked 10 responses in this forum and they are all different.

 

Why do I need to:

- initialize a special variable;

- deal with triggervalues and stuff;

- deal with "null" values because apparently "unchecked" means "null"???

 

To simply check a Yes/No field. Why do I need to reinvent the wheel for this?

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Switches are used for checking the value of a text string.  If you just want to do something different based on whether a yes/no field is yes or no then just use a condition, not a switch.  The following checks a SharePoint field to see if its Yes.  Nothing else is required.

    image.png

    • Trigger conditions are used if you want to keep the flow from running based on a Yes/No field. 
    • I'm not sure where you saw something about a variable.  you will notice I used the True enumeration instead of yes, no, true, or false because there is a case sensitivity issue.
    • Not sure what you mean about No meaning null.  If a yes/no field is set to no then its not null.  If a default is not applied in SharePoint then it might be null.  But that's SharePoint not Power Automate.
  • PrasadAthalye Profile Picture
    on at

    In the condition, convert Yes no column to boolean and compare it with true... I believe this is simple way.

     

    PrasadAthalye_0-1626722512890.png

     

     

  • Community Power Platform Member Profile Picture
    on at

    @Pstork1 @PrasadAthalye ,

    I tried with a simple condition instead of a switch like you both mentioned. The result is the same.

    WorkHard_0-1626724200925.png

     or

    WorkHard_1-1626724261028.png

    or

    WorkHard_2-1626724293301.png

     

    All 3 methods evaluate to false in any scenario. Regardless if the sharepoint list is checked/Yes.

  • PrasadAthalye Profile Picture
    on at

    Can you convert left expression to bool as I requested and then test?

  • Community Power Platform Member Profile Picture
    on at

    I can't see either function you applied in your screenshot.
    1. What's the function on the left side of the condition?
    2. What's the function in the "Set variable"? 

    3. How do I deal with "null" since an unchecked value in sharepoint is considered null?

  • Community Power Platform Member Profile Picture
    on at

    Update. Here's what I put in the left side of the condition.

    Still, no matter what I do, the result is always false.

    WorkHard_0-1626729930780.png

     

     

     

    if(equals(triggerbody()?['Backup'],'Yes'),true,false)

     

    or

    if(equals(triggerbody()?['Backup'],true),'true','false')

     

    Output:

    WorkHard_1-1626730949733.png

     

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Did you set a default on the column?  Is it a standard Yes/No column in SharePoint or is it a Choice column with Yes/No as the Choices?  What trigger are you using and how are you retrieving the Yes/No field?

     

    As long as you set a default it should not be null whether its set to either yes or no.  As you can see from the following screenshots it works as I described.  

    Flow definition

    image.png

    When field is set to Yes

    image.png

    When field is set to No

    image.png

    Could you provide some screenshots of your SharePoint list definition and the flow.  I'll try to suggest why its not working for you.

  • engons Profile Picture
    23 on at

    I have spent two hours today dealing with the same issue with no result. The Yes/No field does not equals to null, false, true, False, True, (the same values into the expressions dialog), or any other idea I could have. Also, when the inputs of the condition are supposed to be null (empty), the condition receives no input and it is set to true! (Condition was that Yes/No fields are true).

     

    I would never have imagined that evaluating a bool variable could be more difficult than programming in brain**bleep** language.

     

    Can someone explain how does boolean variables are managed in power automate?

     

    Thanks

  • ChrisStahl Profile Picture
    14 on at

    For those that might struggle with this as I did, I found an answer: coalesce.

    In my case, I had added a non-mandatory Yes/No column to a SharePoint list. Those columns populate as empty/null which is NOT the same as false in Power Automate, for those developers who (as I did) wrongly assumed it would.

    I wanted to set a Boolean variable using the value stored in this Yes/No field (in this case, whether to send an email or not). So, first I tried:

    ChrisStahl_3-1663086620976.png

    which, of course, errored out when trying to set a null value to a Boolean.

    One option was to set and then reset the values for all of the items in the list so that I knew everything was either true or false with no null values. However, this would not prevent the re-occurrence of this issue in the event another individual was added to the list.

    Enter the coalesce function. This will return the first value in its set that is not blank

    ChrisStahl_4-1663086664970.png

     


    To use in my Set Variable step I wrote:

    coalesce(outputs('Get_next_Teammember_by_ID')?['body/SendEmail'], false)


    where ('Get_next_Teammember_by_ID') is a previous SharePoint 'Get item by ID' step.

    So the step now looks like:

    ChrisStahl_2-1663085931865.png

     

     

    This prevented me from having to write several conditional checks that I found unnecessary.

    I hope this helps someone else out!

  • Community Power Platform Member Profile Picture
    on at

    In SP lists, Yes/No columns use a small tick to check when Yes. You can make this a bool by using true(checked/yes) or false(unchecked/no) from the dynamic Expressions fx, as in screenshot below.PFX solutions.png

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard