JP.jpg

Hi.

Welcome to SharePoint Simply. I am a non-technical SharePoint person just like you. Follow along while I learn things and help you do them.

PowerApps: Submit multiple forms at the same time

Time to do this: 3 minutes

Here's the code, quick and easy:

Patch(PowerAppTest,Defaults(PowerAppTest),FirstFields.Updates,SecondField.Updates,ThirdField.Updates,FourthField.Updates)

Here's how it sets up.

Patch(YourListName.Defaults(YourListName),PowerAppFormonScreenOne.Updates,PowerAppFormonScreenTwo.Updates,etc,etc)

Read on for the context and more details. Or just check out the screenshots.

This drove me crazy for a total of two days. That's way too long. PowerApps is supposed to replace other form editors/creators. But simple things seem so hard to do sometimes.

Here's the scenario I bet you've found yourself in. You have a SharePoint list. It's got a bunch of columns. Maybe 20. Maybe more. You want to use Microsoft PowerApps to create an awesome custom form. The only problem is you want to break up those 20+ columns and only have a user fill out a couple of them per screen.

You can do this part easily enough. You drop in the form part in PowerApps. You hide the columns you don't want to display. You do this on a couple screens. Maybe you build a form with multiple steps and each step has a couple fields pulled from the same list. That's cool. That's easy. But now you want to submit the form and have all the values from all those fields enter into ONE SINGLE LIST ITEM.

You'd think you could just do a little "Submit" function in the OnSelect value for that button or link or whatever you've crafted to submit your new form. You'd be wrong. Using the submit function will only submit fields in each "form" in PowerApps. That means if you have multiple sections in your app, and each section showing multiple fields from the same list, if you submit all those, you're going to get just as many unique items created in your list.

What's the solution? Don't use submit. Use "Patch" instead.

The Syntax

Patch(YourListName).Defaults(YourListName),Form1.Updates,Form2.Updates.Form3.Updates)

This says to PowerApps: Hey, patch together into this list I have an item that takes all my list's default column values and replaces those default values with the updated values I entered in each form in my PowerApp.

Other Gotchas

To get a button to fire: The button needs to be in "Edit" mode.

To get a form field to show up: The form needs to be in "New" mode.

SharePoint: You can see files but other people can't

SharePoint: How to color code a calendar