Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

Writing all records from one gallery to another. And Filtering one gallery with records from another.


Or anyone else that is willing to assist 🙂


In my app, I am trying to setup a feature where users are selected from a first list and added to a second list to be able to view and order an item.  So to that end I have 2 galleries and 2 collections with some buttons that move records between them.



The left gallery is 'GalVisibleChosen' and it displays the users that have been selected and will eventually be patched out to a SharePoint list that contains the ItemID and the UserName/Email that will be able to order this item.  For now it is connected to collection 'ColVisiblePerson'.


The second gallery is called 'GalLocations' and displays the collection 'ColLocations'.  ColLocations is populated directly from a SharePoint list that includes several text fields including UserNames and Emails.


Both Collections are created and populated when the edit screen becomes visible = 



OnVisible = 
ClearCollect(ColLocations, OALocation);
If(ItemEditForm1.Mode <> FormMode.View, ClearCollect(ColVisiblePerson, {DisplayName:"", Mail:""}));



(I had to add that final clear, or my first option in the gallery was a blank username)


My Left and right facing arrows both work fine:

Left (this needs a check for duplicate feature, will add that later)=






And Right=



Remove(ColVisiblePerson, LookUp(ColVisiblePerson, DisplayName=GalVisibleChosen.Selected.DisplayName))



 And the bottom clear all button also works = 



RemoveIf(ColVisiblePerson, true)




My problem is 2 remaining areas, my second to last button is an "Add All" button to add all records from Gal2 to Gal1 (but not duplicates).  And my second problem is filtering on Gal2, if a name is already in Gal1, it should disappear as an option in Gal2


I attempted this for the 'Add All' button, but it just wrote the same username and email multiple times = 



ForAll(GalLocations.AllItems, Patch(ColVisiblePerson,Defaults(ColVisiblePerson),{DisplayName:GalLocations.Selected.Title,Mail:GalLocations.Selected.UserEmail}))




And nothing I have tried for filtering has even half worked...


Could anyone assist with these 2 problem areas?


Changes made.


For saving edits to the 'OAItemList' or saving a new item, I have 3 buttons on the top of the ItemEditScreen, 

Update button = SubmitForm(ItemEditForm1); ResetForm(ItemEditForm1); Back()

Save new button = Patch(OAItemList, Defaults(OAItemList), ItemEditForm1.Updates); ResetForm(ItemEditForm1); Back()

And a delete button = Remove(OAItemList, ItemListGallery.Selected); Back()


Each have visibility settings to only appear when the form is in the correct mode.

As for saving the selections from the Collection to the OAItemRelation list, I haven't written that part yet, still trying to get a collection with the right names, then I will probably try to figure out the patch commands to retrieve the ItemID from OAItemList and patch each record from 'ColVisiblePerson' to 'OAItemRelation' including the ItemID (probably saved in a variable).

Super User III
Super User III


We'll need to make some adjustments!!  Considering that you want to be able to edit (add/remove) when you edit the record, there are some changes that need to be considered.

I have you post marked in my tracking system, so I will get back with you shortly on this as I need to attend to a few other things.

Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Thank you sir, please take your time, this isn't urgent.

Would you have a chance today or tomorrow to look at this again with me?

Super User III
Super User III


Sorry for my delay on this.  I still have it marked in my tracking.  

I will take a look over it if I can today or tomorrow and give you some solutions you can use.

Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

At your convenience senpai. 😊😊


Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,469)