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 )

View solution in original post

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,574)