web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Clearcollect All galle...
Power Apps
Answered

Clearcollect All gallery Items with users updated inputs / Patch updated users input from Gallery Items to Collection

(0) ShareShare
ReportReport
Posted on by

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 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    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.

     

     

  • Yogesh2 Profile Picture
    on at

    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.

  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard