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 Apps / Checking for Boolean V...
Power Apps
Unanswered

Checking for Boolean Values

(0) ShareShare
ReportReport
Posted on by 987

I have a switch control linked to a SharePoint YES/NO field called "Result". I would like to use an if statement to label the control:

 

I have tried this in the OnChange Event but it's not working - any ideas why.

If(Result=true, UpdateContext({Compliant:"Yes"}), UpdateContext({Compliant:"No"}))

FYI: I'm using a text box to check the value of Compliant in run time for now. The textbox is set to Compliant as the default.

Categories:
I have the same question (0)
  • rgruian Profile Picture
    on at

    I suspect it has to do with the type of that field. What shows up if you pipe the Result field into a Textbox instead of a toggle/switch? What values do you see? Are you seeing "true"/"false', or "Yes"/"No" ?

     

    Based on that, the condition in your If invocation will need to adapt accordingly.

     

        UpdateContext({ Compliant: If(Result, "Yes", "No") })

        UpdateContext({ Compliant: If(Result = "YES", "Yes", "No") })

     

    Also, have you considered eliminating the If() invocation altogether?

     

        UpdateContext({ Compliant: Result })

     

    I hope this helps.

  • audrieFCT Profile Picture
    987 on at

    The values are true, false, and I couldn't get it to work. It would work for the false but not on change. I think I realized that I don't like that switch control. I converted to the radio buttons which make the selection more obvious.

     

    Thanks for your help though.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard