cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Clint123
Level: Powered On

Saving data to two SharePoint Lists

Hello all,

 

I am not sure if this has been resolved prior to this but I haven't discovered the solution.

 

So I need to have two lists in one form on Powerapps.

 

Filling out the data is no issue but when I submit the form, it only saves the data to one list and not the other.

 

Is there a way to save the to both lists? 

 

Note: I attempted to use the 'Patch' Function but had no success connecting to the other list.

 

Any help would be great, thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
svijay_001
Level: Powered On

Re: Saving data to two SharePoint Lists

@Clint123 

 

Please use two patch functions on the button click 003.png

 

 

Patch(MyList1,Defaults(MyList1),{Title:TextInput1.Text,Column1:TextInput1_1.Text});Patch(MyList2,Defaults(MyList2),{Title:TextInput1.Text,Column1:TextInput1_1.Text,DateColumn:DatePicker1.SelectedDate});

 

This is will execute both the function synchronously (One After another) 

 

If you would like to Asynchronously - you could concurrent function https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-concurrent  

 

Concurrent(Patch(MyList1,Defaults(MyList1),{Title:TextInput1.Text,Column1:TextInput1_1.Text}),Patch(MyList2,Defaults(MyList2),{Title:TextInput1.Text,Column1:TextInput1_1.Text,DateColumn:DatePicker1.SelectedDate}))

 

This will save data async and the perf will be better. 

 

Output : 

001.png002.png

View solution in original post

6 REPLIES 6
svijay_001
Level: Powered On

Re: Saving data to two SharePoint Lists

@Clint123 
There should be two patch function to update items in each list.

Can you please let me know/share the patch function with me ? 

SilvesterP
Level: Powered On

Re: Saving data to two SharePoint Lists

Hey!

 

What does your patch function look like for each one?

 

For "complicated" patches I would build a flow:

  • Create a flow with PowerApp Button as the trigger
  • Build a parallel branch to check if the item already exists in the respective lists
  • Update or create the item accordingly.

 

Cheers,

P

 

Clint123
Level: Powered On

Re: Saving data to two SharePoint Lists

Here is the Function I have:

 

Patch('My Data Source',Defaults('My Data Source'), {Description1: TextInput2.text, Assigned1: ComboBox1.Selected.DisplayName, DueDate1: DatePicker1.SelectedDate, status1: Radio1.Selected.Value})

 

Thank you.

Highlighted
svijay_001
Level: Powered On

Re: Saving data to two SharePoint Lists

@Clint123 

 

Please use two patch functions on the button click 003.png

 

 

Patch(MyList1,Defaults(MyList1),{Title:TextInput1.Text,Column1:TextInput1_1.Text});Patch(MyList2,Defaults(MyList2),{Title:TextInput1.Text,Column1:TextInput1_1.Text,DateColumn:DatePicker1.SelectedDate});

 

This is will execute both the function synchronously (One After another) 

 

If you would like to Asynchronously - you could concurrent function https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-concurrent  

 

Concurrent(Patch(MyList1,Defaults(MyList1),{Title:TextInput1.Text,Column1:TextInput1_1.Text}),Patch(MyList2,Defaults(MyList2),{Title:TextInput1.Text,Column1:TextInput1_1.Text,DateColumn:DatePicker1.SelectedDate}))

 

This will save data async and the perf will be better. 

 

Output : 

001.png002.png

View solution in original post

Clint123
Level: Powered On

Re: Saving data to two SharePoint Lists

Thank you for that breakdown. I found the first part of my issue with the column names having to match the URL field name not what is on the SharePoint list

 

It picked up my function which is great.

 

BUT

 

This is where my second issue comes in. Text inputs and date pickers are fine, but I can't seem to have it pick up other controls. Please see the pictures below.

 

Untitled.pngThe Patch function now works.

 

Untitled2.pngPatch function can't find Radio1 control but you can see it there on the left tree.Untitled1.pngWhen I specify the data to patch the whole function has a red underline.

 

Any help would be sensational! Thank you.

SilvesterP
Level: Powered On

Re: Saving data to two SharePoint Lists

What's the error when you mouseover the error?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 265 members 4,617 guests
Please welcome our newest community members: