Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 0SUoLfq732ABJPBy9kTmwb
Power Apps - Building Power Apps
Unanswered

Checking for Boolean Values

Like (0) ShareShare
ReportReport
Posted on 27 Oct 2016 21:21:57 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.

  • audrieFCT Profile Picture
    987 on 28 Oct 2016 at 01:43:03
    Re: Checking for Boolean Values

    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.

  • rgruian Profile Picture
    on 27 Oct 2016 at 22:17:02
    Re: Checking for Boolean Values

    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.

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…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 58

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 42 Super User 2025 Season 1

Overall leaderboard
Loading started
Loading complete