web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Select All checkbox bu...
Power Apps
Unanswered

Select All checkbox button quick question

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi there, 

i have a 'select all' checkbox that sets a variable if it is true or false. 

So - on check will be : Set(checkallVar,true)

and OnUnCheck will be : Set(checkallVar,false)

Within each chx box the default is : 

If(checkallVar=true,true,false)

 

My screen also saves to a collection when it is saved, and also on the hidden it resets all checkboxes. 

So I want the checkboxes to check the value of the collection and / or highlight from the selectall box. 

Anyone with anyideas ? I have put an if statement in the default like this , but i dont have it correct : 

 

If(
checkallVar = true,
true,
If(
First(Collection).'Column one' = 'Yes or No'.Yes,
true,
If(checkallVar = false,false)
)
)

Categories:
I have the same question (0)
  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Anonymous, if you share some screenshots, it would make it easier to understand your question. One thing as a sidenote, you don't need to set a variable to hold the status value of your checkbox, you can use Checkbox1.Value and it will be true if checked and false if unchecked. 

     

    CheckBox.Value.gif

     

    Regards,
    Ahmed
    If my reply helped you, please give a 👍. And if it has solved your issue, please consider Accept it as the Solution to help other members in the community find it more.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi there, id thought id give more info. 

    At the moment, each checkbox has this in the default so it shows either / true of false of the checkbox result from an save (stored in a collection). 

     

    If(First(InspectionItemTPHCollection).'PHV Licence' = 'Yes or No'.Yes,true,false)

     

    As you can see, it is stored as an optionset and i am just changing that to true or false. This works well. 

     

    On the Select All - i am setting a variable like this on the OnSelect and the alternative on the OnUnSelect: 

    Set(checkallVar,true)

     

    So i need to overwrite the default on the checkboxes to set to this variable on selectall. but when this is not SELECTED on not NOT SELECTED then show the result from the collection as per : 

     

    If(First(InspectionItemTPHCollection).'PHV Licence' = 'Yes or No'.Yes,true,false)

     

    Thanks ! 

     

     

     

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Anonymous, 

     

    You can think of using the With Function:

     

    With(
     First(Colletion),
     If(
     'Column one' = 'Yes or No'.Yes,
     true,
     checkallVar = false,
     false
     )
    ) 

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Very nice solution but its not really working completely.. 

    The checkboxes are defaulting as true (so its best to start as false). 

    And if i deselect them all , i have to press Select all twice and then it will tick all the columns. 

    Any ideas ? 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    are we missing the condition if checkallvar = true ? 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi there, 

    I have added this to all the chxbox defaults : 

     

    With(
     First(InspectionItemTPHCollection),
     If(
     'PHV Licence' = 'Yes or No'.Yes,
     true,
     AllChecked = true,
     true,
     AllChecked = false,
     false
     
     )
    ) 

    And this kinda works... But when you un-select-all it comes back to its saved position and not an empty position. 

    Any ideas ? 

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Anonymous , use the Clear function to clear the collection after you submit

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I cannot use the clear function, because 'the users need to carry on with their work' if they come out of the screen or not. So once its saved, its saved. 

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Anonymous, try this:

     

     

     

     

    With(
     First(InspectionItemTPHCollection),
     If(
     AllChecked = false,
     If('PHV Licence' = 'Yes or No'.Yes,
     true,false),
     true
     
     
     )
    )

     

     

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It isnt even saving now :(... I think it depends on the sequence you put it in , in the With statement. Thankyou very much for your continued help... I am completely at a loss... 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard