cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

Difference Between SubmitForm and Patch

Hi

 

If you look at the various Sample Apps, they seem to be evenly split between using SubmitForm to update the datasource and Patch to update a DataSource.

 

So what is the difference between SubmitForm and Patch and under what circumstances should you use either ?

 

Just to confuse people even more, there is then the Update (and UpdateIf) command.  When should that be used over the SubmitFormn and the Patch command.

 

Thanks

 

Nigel

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Difference Between SubmitForm and Patch

The documentation has a good discussion about Patch - generally used for more complex updates.   When you need more control.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

 

Submit form is used to update the contents of an edit form in a straight forward way. 

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-form

 

View solution in original post

Highlighted
Super User
Super User

Re: Difference Between SubmitForm and Patch

Hi @NigelP 

 

I did some testing/investigation on whether there were any performance differences - you can see it here: https://youtu.be/LKcuPI0dxEg 

 

Having made a few apps now, I tend to use Patch more than SubmitForm. It is more flexible and to me, it is simply clearer what is going on and gives that little bit more control.

View solution in original post

3 REPLIES 3
Highlighted
Power Apps
Power Apps

Re: Difference Between SubmitForm and Patch

The documentation has a good discussion about Patch - generally used for more complex updates.   When you need more control.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

 

Submit form is used to update the contents of an edit form in a straight forward way. 

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-form

 

View solution in original post

Highlighted
Super User
Super User

Re: Difference Between SubmitForm and Patch

Hi @NigelP 

 

I did some testing/investigation on whether there were any performance differences - you can see it here: https://youtu.be/LKcuPI0dxEg 

 

Having made a few apps now, I tend to use Patch more than SubmitForm. It is more flexible and to me, it is simply clearer what is going on and gives that little bit more control.

View solution in original post

Highlighted
Helper I
Helper I

Re: Difference Between SubmitForm and Patch

I have a similar questions. Earlier I was using Submit form to submit multiple forms to one data source. I realized, the best way is to use Patch() if using multiple screens for one data source.

Patch(
    'DataSource',
    Defaults('DataSource'),
    Form3.Updates,
    Form3_1.Updates,
    Form3_2.Updates
);
Notify("Form submitted successfully");

This works beautifully by storing just one record in the datasource table. But it breaks my other functionality. I had another form, which would use a different data source but should have a lookup of ID same with previous forms. The formula used was below:

ForAll(
    ColSelectedReq,
    Patch(
        'User Data Element',
        Defaults('User Data Element'),
        {'Unique ID': Form3_2.LastSubmit.ID},
        {'Data Element': Text('Data Elements')}
    )
)

 

This basically, creates a collection and save the records of a form for another SharePoint list, but also reference the unique ID generated from the previous forms. This was working with the Submit(form) button but stopped working after I used the patch function. 

Can someone please help?

 

Helpful resources

Announcements
secondImage

New Return to Workplace

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

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,563)