Hello SharePointers,
Today we are going to see some development hacks, we will see How To Save Records In Multiple List Using Power Apps Patch() function
Introduction
In some scenario we need to save record in one form to the multiple list in SharePoint using power apps. So for this we will create one form with controls and save records in the multiple SharePoint lists.
Now we are going to see how to save record in multiple lists in PowerApps using patch() function.
Scenario
Here we will create two SharePoint lists “Student” and “Student_Information” and we will create a PowerApps form and then we will use patch() function to save record in multiple list.
To achieve the targeted functionality please follow steps as below:
Send Approval request to SharePoint Group in MS-Flow
- Create “Student list with following columns
- Create a “Student_Information” list with following columns
Let’s create Canvas App from blank in PowerApp Studio with App Name “StudentRecord”
Now Connect to Data from SharePoint list using SharePoint connector
Connect your SharePoint Site
Now Select your list “Student” & “Student_Information”
Now we are adding required controls for our app like(Labels, Dropdowns, Button, DatePicker)
In this scenario we are saving data in two lists so we require two patch() functions.
Select Submit Records button on the OnSelect property of that button use patch function as below,
Patch(Student,Defaults(Student),
{
Title:txtStudName
});
Patch(Student_Information,Defaults(Student_Information),
{
Title:txtStudName,
PhoneNumber:txtPhoneNo,
Address:txtAddress,
DOB:DatePicker1.SelectedDate
});
Notify("Record Sucessfully Saved",NotificationType.Sucess);
After this we will run our App and enter Student details in form it will look like as below
Record also entered in SharePoint list “Student and Student_Information” as shown below
Summary
Microsoft Flow Interview Questions and Answers
In this article we learned how to use Patch() function in PowerApp to Save data in multiple list on Single form
I hope you like this article How To Save Records In Multiple List Using Power Apps Patch() function. Give your valuable feedback and suggestions in the comments section below.
2 thoughts on “How To Save Records In Multiple List Using Power Apps Patch() function”