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 / Update Checkbox Value ...
Power Apps
Answered

Update Checkbox Value OnSelect

(1) ShareShare
ReportReport
Posted on by 84

New to PowerApps and working on a new solution.  I can't figure out how to do something that seems quite simple...

 

I need to update a checkbox control's value to true (i.e. "checked") when an icon is clicked.

In the Icon configuration, what formula do I need to enter into OnSelect?

 

I have tried using Set and UpdateContext, but I think those only work with variables.  This is updating the value of a control....

 

Checkbox1.Value=true

 

Appreciate the advice.

Categories:
I have the same question (0)
  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Pegger 

    Like this:

     

    checkboxfromicon83945.gif

     

     

    (Screen) Screen1 OnVisible:

    Set(_CheckedExampleVariable,false)

     

    (Checkbox) Checkbox1 Default:

    _CheckedExampleVariable

     

    (Icon) Star1 OnSelect:

    Set(_CheckedExampleVariable,true);

     

     

     

  • Pegger Profile Picture
    84 on at

    It worked.  I was hoping there was a way to do it without a variable, i.e. set it directly, only because I will have to establish 10-15 variables, but it is functional so thank you!

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Pegger 

     

    If that exists we would be curious of it.

     

    However, this type of attempt:

     

     

     

    Checkbox1.Value=true

     

     

     

     

    is actually antipattern in the thinking for Power Apps right now, and it is something that is not possible at all in any way we know of currently. If someone else from this forum disagrees, we would be curious to know what is the alternate way to do it with the Checkbox1.Value=true kind of way. To our understanding, the only way is the way we gave. It can be a "context variable" instead of a whole variable if it is guaranteed that all the operations will take place on the same screen only (in our example, those are variables that can work from any screen, and not context variables scoped to one screen) - that is about the only thing we believe could be done to slightly improve on it is make them context variables if you are absolutely sure they would be on one screen - but if you ever use it from other screen, e.g. if the Icon is clicked from a screen other than the one the checkbox is present on, then it must be a variable just like in our example.

     

    Regarding:


    @Pegger wrote:

    It worked.  I was hoping there was a way to do it without a variable, i.e. set it directly, only because I will have to establish 10-15 variables, but it is functional so thank you!


     

    Another way to use "one thing" instead of "multiple things" could be an inline Collection with multiple Columns on the first Record of the same Collection, and this can be accessed from any Screen as well - but this is less straightforward to use than just the Variable of our simple example -  and you would want to be careful, we would not really recommend it. It is even trickier if you use multiple Collection Records instead of a Collection with just one Record and multiple Columns. We recommend instead to just use multiple variables as it is probably more straightforward that way. We just wanted to mention it in case you would find this way with the Collection interesting as well.

  • Pegger Profile Picture
    84 on at

    I trust your experience over mine!  But surely would be curious if there is another way.  Regardless, you have helped me get past the next hurdle.  Thanks again!

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