How to Patch Power Apps Data into Different SharePoint Lists
Question details
The user needs a method to save submitted details and order data from a Power Apps shopping cart application into different SharePoint lists depending on whether the customer is new or existing.

- Product
- Power Apps
- Device & OS
- not provided
- Scenario
- Developing a Power Apps shopping cart application that evaluates customer types and routes order data to specific SharePoint lists.
- Observed behavior
- Requires a structured way to identify the customer type, navigate to the appropriate app screen, and submit the order record to the correct SharePoint list.
Ensure you have the necessary edit permissions for the target SharePoint site and that your SharePoint lists are already created with the appropriate columns.
Use Filter, Navigate, and Patch Functions to Route Data
This method uses conditional logic to identify the customer type, directs the user to the correct screen, and uses the Patch function to save the data to the corresponding SharePoint list.
By setting up distinct screens and using the Defaults function within your Patch formula, you can ensure that new records are correctly created in either the new customer list or the existing customer list without data overlapping.
Create your base lists in your SharePoint site. You will need a 'CustomerList' for identifying users, a 'NewCustomerList' for new sign-ups, and an 'ExistingCustomerList' for returning customer orders.
In Power Apps Studio, design a welcome screen. Then, create separate submission and order screens tailored for New Customers and Existing Customers.
On the welcome screen, use the Filter function to check if the current user exists in the 'CustomerList'. Based on the result, use the Navigate function on your entry button to direct the user to their respective screen.
On the submit button of the order screens, write your Patch formula. For new customers, use Patch(NewCustomerList, Defaults(NewCustomerList), {ColumnName: Value}). Replace 'NewCustomerList' with 'ExistingCustomerList' on the returning customer screen.

Manage Your Exported SharePoint Data with WPS Office
While Power Apps handles complex application building and SharePoint integration, you can efficiently manage, analyze, and report on your exported SharePoint customer lists using WPS Office. It provides a lightweight, highly compatible, and completely free alternative to Microsoft Office for all your document and spreadsheet needs.

Frequently Asked Questions
Why is my Patch function not saving data to the SharePoint list?
This usually happens due to mismatched column data types between Power Apps and SharePoint, or missing required fields in the Patch formula. Ensure your data types align perfectly and all mandatory SharePoint columns are included in your patch record.
Can I use a single screen instead of multiple screens for different customer types?
Yes. Instead of navigating to different screens, you can use an 'If' statement within your Patch formula on a single screen to dynamically select the target SharePoint list based on a local customer type variable.
How do I use the Defaults function in a Patch formula?
The Defaults(ListName) function is used within the Patch formula to indicate that you want to create a new record rather than updating an existing one. It generates a base template for a new row in your specified SharePoint list.




