Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

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

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 394 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 193

#3
stampcoin Profile Picture

stampcoin 149

Overall leaderboard
Loading started