cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Joeri089
Level: Power Up

Save gallery data in SharePoint list

Hi,

 

My app is nearly finished, the one and only thing missing is a button which Onselect will save the items from my gallery (a SharePoint list) to another SharePoint list.

When I try this, I get an error that there is an incompatible type (table). 

Basically when I press the button, all the content from List A needs to be added to List B. 

3 REPLIES 3
PauwelsSven
Level 8

Re: Save gallery data in SharePoint list

Hi,

 

You will need to make a ForAll loop for your gallery.

Like that you will write records to the new SP list instead of a table type.

Then use Patch to  write the data to another SP-list.

Here you have more information how to use the Patch statement:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

Joeri089
Level: Power Up

Re: Save gallery data in SharePoint list

Thank you Sven.

 

Do I use the ForAll before the Patch? I can't seem to figure this out.

 

ForAll(Gallery1.AllItems, Patch(..........))

 

Like this or? 

Highlighted
PauwelsSven
Level 8

Re: Save gallery data in SharePoint list

Hi,

 

Patch doesn't work in a ForAll, excuse me my bad.

This Forum Post is about the same issue you face:

https://powerusers.microsoft.com/t5/General-Discussion/Patch-Gallery-items-to-SharePoint/td-p/160802