Skip to main content

Notifications

Community site session details

Community site session details

Session Id : o2ZifslGnRH5Pz5ovk6J/M
Power Automate - Building Flows
Unanswered

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

Like (5) ShareShare
ReportReport
Posted on 19 Jul 2021 19:07:48 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?

 

  • Suggested answer
    Ellis Karim Profile Picture
    10,927 Super User 2025 Season 1 on 02 Aug 2024 at 20:57:27
    How to check the value of a Sharepoint Yes/No field in a switch condition?
    You can use 1 for Yes:
    Available eq 1
     
    And false for NO:
    Available eq false
     
    If the column does not contain a value (i.e. Yes or No was not selected or set), it will contain a null value.
     
    ID 2 in the SharePoint list below does not contain a value i.e. Yes or No was not selected or set), so its value is null.
     
     
     
    [
      {
        "ID": 1,
        "Available": true
      },
      {
        "ID": 2,
        "Available": null
      },
      {
        "ID": 3,
        "Available": true
      },
      {
        "ID": 4,
        "Available": false
      },
      {
        "ID": 5,
        "Available": true
      },
      {
        "ID": 6,
        "Available": true
      }
    ]
     
     
     
  • Suggested answer
    SS-02081221-0 Profile Picture
    on 02 Aug 2024 at 12:30:27
    How to check the value of a Sharepoint Yes/No field in a switch condition?
    Making the assumption that you would like <null> to be treated as "no" rather than "yes", you can use the coalesce function - equivalent to "isnull()" in some other languages.
    coalesce(1st param,2nd param) returns its second parameter if the first is null.
    so where you would expect just to use [boolean], use coalesce([boolean],false)
     
    e.g. a boolean test of a yes no field to produce string output from an if statement might be:
     
        if (coalesce(['MyYesNoField'],false),'The box is checked','The box is not checked')
     
    or any other usage you might want.
    Hope this helps - it did me when I discovered that an unchecked box in Teams/Sharepoint was actually null not false.
  • SamAtPower Profile Picture
    4 on 20 May 2024 at 07:30:59
    Re: How to check the value of a Sharepoint Yes/No field in a switch condition?

    Hi,

     

    I am having the same issue.  I difined a Yes/No colume in a LIST and check it in Power Automate.

     

    I am sure it's a Yes/No column not Choice or anything else.

     

    SamAtPower_0-1716189797464.png

     

    I got it worked in Power Automate Condition node as below shows,

    SamAtPower_1-1716190046706.png

     

    However, Filter arrary node did not work for me  

    SamAtPower_2-1716190128572.png

     

  • Pstork1 Profile Picture
    66,075 Most Valuable Professional on 26 Feb 2024 at 22:01:47
    Re: How to check the value of a Sharepoint Yes/No field in a switch condition?

    If the column is defined in SharePoint as a Yes/no column then it should work. Are you sure the column isn't a choice column or something else? Have you added a Compose just before the condition to see what the actual value of that column is?

  • MShelnutt Profile Picture
    381 on 26 Feb 2024 at 21:56:33
    Re: How to check the value of a Sharepoint Yes/No field in a switch condition?

    @Pstork1  This does not work for me.

  • MShelnutt Profile Picture
    381 on 26 Feb 2024 at 21:49:39
    Re: How to check the value of a Sharepoint Yes/No field in a switch condition?

    @Pstork1 Hi, I know this is an older thread, but I am also dealing with an issue getting Power Automate to update a column based on if a Yes/No column changes from its default "No" to be "Yes", and it will not recognize the status change from "No" to "Yes", using either "true", or "Yes" in the Condition.  I found this screenshot you posted here and put that in and it is still showing the Expression result as being false.

    Could you take a peek?-
    https://powerusers.microsoft.com/t5/Building-Flows/Update-Item-Not-working/m-p/2625282#M294264 

  • cujones4 Profile Picture
    2 on 04 Feb 2024 at 20:01:12
    Re: How to check the value of a Sharepoint Yes/No field in a switch condition?

    I made a Choice column, added No and Yes, made No the default, and used a Condition action where if Choice is equal to Yes, perform Yes action. 

  • thecypher Profile Picture
    24 on 03 Jan 2024 at 10:24:55
    Re: How to check the value of a Sharepoint Yes/No field in a switch condition?

    The logic is actually quite simple. You do the same check, as you do for an empty field.

    If the field isn't EMPTY/NULL then it must be checked.
    Same logic applies if you do a conditional check. 

     

    EASY WAY using "Get Items" to get all or specific "Checked Items" as usable array.

    After adding your initial Trigger (Manual, When an Item is created or modified, etc.)
    1. Add Get Items

    2. In Get Items go to Filter Query

    3. Enter ODATA like so

                ColumnName ne null

                (note if typing null doesn't work for you, then click on add as an expression (fx) and add the null this way)

     

    Now when you run your Automation the Get Items connector will get all Items that are checked. 

  • Pstork1 Profile Picture
    66,075 Most Valuable Professional on 07 Dec 2023 at 21:07:56
    Re: How to check the value of a Sharepoint Yes/No field in a switch condition?

    Please post this as a new question.  You'll get more responses and others will be able to find the answer more easily later. It would also help if you provided more details. Checking a Yes/No field in SharePoint in Power Apps using an actual Boolean value will work. If its not working for you please post screenshots in a new post and we'll get you an answer.

  • ObiRickC137 Profile Picture
    44 on 07 Dec 2023 at 21:07:46
    Re: How to check the value of a Sharepoint Yes/No field in a switch condition?

    I used the Initialize a Variable action to take the boolean data collected and convert it into a string. Once a string, the conditional parameter can be a True or False

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,075 Most Valuable Professional

Leaderboard
Loading started