If you have been playing around with Power Apps you would probably be familiar with SubitForm and Patch functions. Both pretty much does the same things but there could be days where you want to use both of them together.

So lets start a quick demo on how to get this one.

For my Demo i will create a simple application with a Gallery, Edit and Add Screens.

Usually for SharePoint we are using Submit Form Action however in this case we will use the Patch function on the Submit button.

In my scenario, i want to Patch Data source of Two Child (based on selection) Lists also the Master list

So i want that whatever the Product is selected, it will update the master list as well as my Individual Product lists.

So first of all i get the value of products by using the Selected function of the combo box on my edit Screen.

DataCardValue14.Selected.Value="Product A"

Now I will Patch the Data Source

If(DataCardValue14.Selected.Value="Product A",Notify("Its A");Patch('Project A',Defaults('A'),{Title:DataCardValue5.Text}))

Similarly I will do for all my products

If(DataCardValue14.Selected.Value="Product B",Notify("Its B");Patch('Project B',Defaults('Project B'),{Title:DataCardValue5.Text}))

With that working i will use nested if to check products and Patch my source

If(DataCardValue14.Selected.Value="Product A",Notify("Its A");Patch('Project A',Defaults('Project A'), {Title:DataCardValue5.Text}),If(DataCardValue14.Selected.Value="Product B",Notify("Its B");Patch('Project B',Defaults('Project B'),{Title:DataCardValue5.Text})))

And for the Master List i will just the SubmitForm(form1) formula.

In this way i can Patch multiple sources and also use SubmitForm all together

Comments