cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Microsoft
Microsoft

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
Highlighted
Microsoft
Microsoft

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 ? 

Highlighted
Frequent Visitor

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

 

Highlighted
Frequent Visitor

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
Microsoft
Microsoft

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

Highlighted
Frequent Visitor

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.

 

The Patch function now works.The Patch function now works.

 

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

 

Any help would be sensational! Thank you.

Highlighted
Frequent Visitor

Re: Saving data to two SharePoint Lists

What's the error when you mouseover the error?

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,127)