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

Saving a Gallery to an empty table in Dataverse

Hi all,


Does anyone know is it possible to save a gallery of items to an empty table in Dataverse?


I have generated the items in my Gallery with a ClearCollect. I am now trying to make these records permanent by saving them to an empty table I made in Dataverse. I've been trying to Patch the items through with no success  


Many thanks


Super User
Super User

This can definitely be done but just so I can have a bit of understanding and think about the possible performance issues on average how many rows are you expecting in the gallery? could it be a few thousand or is it likely less than that? and does the collection columns come from that datasource whcih you wish to patch to or is it from another source e.g. does the schema match
if it matches we can just Collect(Datasource,Collection) 

In most cases for me it does not match so I have to do:


ForAll(CollectionName As RecordtoPatch, Patch(DatasourcebeingPatchedto,Defaults(DatasourcebeingPatchedto),{1stRecordName:RecordtoPatch.Name, Col2:RecordtoPatch.Address,'Column Three':RecordtoPatch.number}))


or something like the above to map it out give it a try if you are unsure what i mean provide an example of your patch (e.g. this columns in collection goes to this column name in datasource if you havent wrote a patch) your collection name and the end datasource name it goes to


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

Advocate II
Advocate II

Hi @AJ_Z ,


Thanks for coming back, this would be for a hew hundred rows max. No the Collect columns I generated with a Clearcollect shown below.


This then gives me the Gallery shown below here. I've tried using the the ForAll function to Patch these Gallery items to my empty datasource called "projs" but it gives me an unknown error when I click Update. 



This is the correct approach right ?


Many thanks

Super User
Super User


In your formula for update, you are referencing controls...not the properties of those controls.

So your formula should look more like this:

        {crdfc_int_proj: TexdtInput3.Text,
         crdfc_date_proj: DatePicker3.SelectedDate

The above will create new records in your projs table...assuming no other fields are required.


Kudos for using the ForAll properly!!!


I hope this is helpful for you.



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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes 


Ive tried a few variations of this. I am able to Patch through the ID to the Name field, but cannot patch my interest or the date with the above syntax.


Ive split it into 2 Patch functions below, the approach seems to be the exact same to me. The first Patch function works but the 2nd doesn't - Is there something obvious Im missing here?









Many thanks


Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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