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
Conor
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
Signature:
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:
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
In your formula for update, you are referencing controls...not the properties of those controls.
So your formula should look more like this:
Patch(projs,
ForAll(Gallery4.AllItems,
{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.
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
Conor
User | Count |
---|---|
164 | |
91 | |
67 | |
64 | |
63 |
User | Count |
---|---|
212 | |
157 | |
96 | |
81 | |
73 |