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 / Toggle that selects al...
Power Apps
Answered

Toggle that selects all checkboxes in gallery and updates multiple data when is check

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, I have a problem, The thing I wanna do is a toggle that when is onCheck ,checks all checkboxes of the gallery, I have putted in checkbox default (toggle.Value) but I want also a multiple "Patch", the data only is modified when I click the checkbox but I want to modify the data throw the toggle ,Im confused, I will appreciate help, thanks.

 

(if you see the pictures, when I click the checkbox the data updates, but when I click toggle ,the checkbox changes but no data update).

 

Screenshot (5).png
Screenshot (4).png
Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Are you really wanting to update ALL of the records in the gallery when your master toggle is turned on?

     

    Your Default property for the Checkbox permisCheck should be:

    ThisItem.Permisos || SeleccionaTots.Value

    In your current formula, the SelecionaCap value doesn't really play a part in the logic.

     

    But the question still is the first one above.  Do you want to actually update all the records on the change of the master checkbox (SeleccionaTots) or do you want to do this through some other action?

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi! thanks for the answer, I want to update with de master toggle and with the checkbox ,for example you can select individually who haves permissions with the checkbox and if you want all users with permission you click the toggle .

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Then the only thing you need to concern yourself over is the OnCheck and OnUncheck actions of the SeleccionaTots toggle.

     

    OnCheck:

    Patch(USUARIS_DEP,
     ForAll(yourGallery.AllItems,
     {ID: ID,
     Permisos: "True"
     }
     )
    )

     

    OnUncheck:

    Patch(USUARIS_DEP,
     ForAll(yourGallery.AllItems,
     {ID: ID,
     Permisos: "False"
     }
     )
    )

     

    Nothing else needs to be done because the Default property of the checkbox in the gallery will then change based on the underling record (unless your gallery is based on a static table)

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    i've tried this but it goes visually so slow,I have a counter below and goes very slow ,(1,...2,....3...),it sums the users with permissions slowly,I want also that when is master toggle checked the counter goes to top automatically ,fast..,

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    My guess is you had it backwards before - i.e.  ForAll(..., Patch(

    That will be very slow.  However the formula I provided you is using the ForAll properly - Patch(..., ForAll(

    That will be much faster.

     

    However, this is the only choice you have if you are not doing the data operations in some other place.  If you had a "commit" button or something like that, then you could make it fast.  But, if the toggle is the only control to govern the data operations, then use the formulas as I provided...do not use the ForAll backwards.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    yes , its faster! thanks I will accept as a solution

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Yes...when using the ForAll properly it makes all the difference!!

     

    If you need anything even more faster than that, then you need to consider a separate "submit/commit" button that would contain the data operations.

     

    Glad that worked for you!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard