Is there a way where we can create a collection from PowerApps Gallery which can capture all the items from gallery along with the Input Dropdown values passed by users.
I have tried two methods -
a) Clearcollect required columns from Gallery but it doesn't store the Input values made by user from Drop down field, instead it shows the DataSource values itself which isn't required.
b) Patch the required columns from Gallery to a collection with "For All" and Patch function with This record/This Item property. It's working but running very slow.
I am working on large dataset which goes beyond 2000 records where I am using collections to move data from source to Gallery then Gallery to a new collection with specific columns which are fed by Users and then Patch just those columns through Patch(Datasource,Collection with limited columns) to optimize the Ingestion of data and submission of records by users.
@WarrenBelz , @BCBuizer , @v-bofeng-msft @v-qiaqi-msft , @RezaDorrani
Hi @Yogesh2 ,
As far as I know what you described is the fastest method since UpdateIf is not delegable, so can't be applied to the datasource directly if it has more than 2000 items.
Hi @BCBuizer ,
I did try to use this formula
ClearCollect(Collection, Gallery1.AllItems)
but there was an error stating that the data source provided is invalid.
Also, as you mentioned Gallery would only show 100 records from data source at once until it's scrolled down further to load more records. For this I have loaded the data from Data source to a collection and to check if all the records are loaded or not, I have used count function as well which does show the total records in the collection. The only challenge I am facing is to collect the updated information by users from the Gallery to the new collection or update the existing collection with the updated information.
Alternatively, after posting the question I had used Updateif function to update the records in the collection and then patch Collection to datasource using Patch(Datsource,collection) from gallery. It's better than ForAll + Patch function but I am wondering if there's some other better method to optimize this which could take less time comparatively.
Hi @Yogesh2 ,
In theory you can simply use the below formula:
ClearCollect(Collection, Gallery1.AllItems)
In practice there are some restrictions though:
If Gallery1 is connected to a datasource, it will only load 100 items unless the user scrolls all the way to the bottom of the gallery when another 100 items are loaded. The is will continue until all items in the datasource are loaded. Whenever the formula is executed, only the items that are loaded will end up in the collection.
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
58
Michael E. Gernaey
42
Super User 2025 Season 1