cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vsolanon
Helper III
Helper III

Include CheckBox to select all record displayed in Gallery

Hello Experts!

 


I am working on applications to track trips.
I have a Gallery that displayed all the trips reported, which is connected to a SharePoint list. In the SharePoint list, I have a person column named "Receiving HR", who is the person in charge of the trip. This person might be in multiple records.


My challenge is that when the person "Receiving HR" is moved to another role, I need to remove his/her name from all the records and replace it with a new person. Not all the records will be transferred to 1 single person, it may to more than one. Due to this, I need to have an option to select all the records or to unselect a record, in case we don't want to update it.
I almost got this! but have the following problem: I need to include a checkbox that when selected, selects all the gallery and updates a column I created for the process. Please let me explain what I have done so far

 

 

-I have created two ComboBox (ComboBox1 and ComboBox2) that displays the names of all the employees in the company


-I created a Button1 that once selected, will update the Gallery to display only the items that have as "Receiving HR" the person selected in the previous ComboBox1using the formula: ClearCollect(collectionUpdate,AddColumns(Filter ('SharePointList', 'Receiving HR'.DisplayName=ComboBox1.DisplayName),"IsChoosen", false )

 


-I update the Gallery items property for the collectionUpdate and include a CheckBox1 in the Gallery. For the CheckBox I used the following properties: Default: ThisItem.IsChoosen, OnCheck: Patch(collectionUpdate, ThisItem, {IsChoosen:true}), OnUncheck: Patch(collectionUpdate, ThisItem, {IsChoosen:false})

 


-Lastly, I include a new Button2, that once selected, will update the columns "Receiving HR" of all records selected with the new employee. ForAll(RenameColumns(Filter(collectionUpdate, IsChoosen), "ID","EID"), Patch('SharePointList',LookUp('SharePointList', ID = EID),{'Receiving HR':Combo2.Selected}); Patch(collectionUpdate, LookUp(collectionUpdate, ID = EID), {'Receiving HR':ComboBox2.Selected}))

 

 

I have been battling to know how to include a new ComboBox in order for the user to have the option to select all at once, in case it is required. 


I know I can create the default value of the ComboBox1 to true, but I would like to include instead this new ComboBox2 to select all. I use this video from Shane to build the process https://www.youtube.com/watch?v=0xZ4fMJbLvk 

ComboBox.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I really appreciate your support! 🙂
Thank you!!

1 ACCEPTED SOLUTION

Accepted Solutions
vsolanon
Helper III
Helper III

Hi,

 

I found a simple workaround by re-using a formula on the second Checkbox.

OnCheck: ClearCollect(collectionUpdate,AddColumns(Filter ('SharePointList', 'Receiving HR'.DisplayName=ComboBox1.DisplayName),"IsChoosen", true )

OnUncheck: ClearCollect(collectionUpdate,AddColumns(Filter ('SharePointList', 'Receiving HR'.DisplayName=ComboBox1.DisplayName),"IsChoosen", false )

View solution in original post

2 REPLIES 2
vsolanon
Helper III
Helper III

Hi,

 

I found a simple workaround by re-using a formula on the second Checkbox.

OnCheck: ClearCollect(collectionUpdate,AddColumns(Filter ('SharePointList', 'Receiving HR'.DisplayName=ComboBox1.DisplayName),"IsChoosen", true )

OnUncheck: ClearCollect(collectionUpdate,AddColumns(Filter ('SharePointList', 'Receiving HR'.DisplayName=ComboBox1.DisplayName),"IsChoosen", false )

KranthiTupakula
Responsive Resident
Responsive Resident

@vsolanon 

 

This is pretty simple. 

 

1. Insert a new input called "CheckBox" 

2. Change CheckBoxOption Default property into Checkbox1.Value=true

Here is the post to the original link

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Select-All-Button-In-Gallery-CheckBox/m-p/47...

https://youtu.be/Jc_JLxMqtFs

 

___________________

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,154)