cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chinda
Helper III
Helper III

Submit button not working (Using PATCH function, showing Error Message)

Hello All, 

 

I am currently making a form on PowerApps. I started with a blank table on SharePoint listing all the questions. From there I clicked on 'Integrate', then 'Power Apps' then Customize forms, as I was led to believe by this video that this was the correct way to link a Power Apps form (that would need routine updates) to a SharePoint repository.  

 

However, my submit button is showing a big red error 'X', when it never did during the construction of the form (see code below and 'Current Form Example' attached). This error is preventing the data from being submitted to the SharePoint repository.

  1.  Code:
    1. Patch(
      'Form_Name',
      Defaults('Form_Name'),
      EditForm1.Updates,
      EditForm2.Updates,
      EditForm3.Updates,
      EditForm4.Updates,
      EditForm5.Updates
      );
      Navigate(Success_Screen);

 

What do I need to fix here? Looking for guidance

1 ACCEPTED SOLUTION

Accepted Solutions
Nogueira1306
Super User
Super User

I think that the error is because you are trying to crete multiple itens in only 1 patch function.

What you can do is:

 

Patch(
'Form_Name',
Defaults('Form_Name'),
EditForm1.Updates);
Patch(
'Form_Name',
Defaults('Form_Name'),
EditForm2.Updates);
Patch(
'Form_Name',
Defaults('Form_Name'),
EditForm3.Updates);
Patch(
'Form_Name',
Defaults('Form_Name'),
EditForm4.Updates
);
Patch(
'Form_Name',
Defaults('Form_Name'),
EditForm5.Updates
);
Navigate(Success_Screen);

 

But, if you are using Forms, why dont you use SubmitForm Funciton?

 

View solution in original post

3 REPLIES 3
Nogueira1306
Super User
Super User

I think that the error is because you are trying to crete multiple itens in only 1 patch function.

What you can do is:

 

Patch(
'Form_Name',
Defaults('Form_Name'),
EditForm1.Updates);
Patch(
'Form_Name',
Defaults('Form_Name'),
EditForm2.Updates);
Patch(
'Form_Name',
Defaults('Form_Name'),
EditForm3.Updates);
Patch(
'Form_Name',
Defaults('Form_Name'),
EditForm4.Updates
);
Patch(
'Form_Name',
Defaults('Form_Name'),
EditForm5.Updates
);
Navigate(Success_Screen);

 

But, if you are using Forms, why dont you use SubmitForm Funciton?

 

chinda
Helper III
Helper III

Thank you, it worked! 

 

Also, @Nogueira1306  I used Patch because my form is on multiple pages,  and I heard that PATCH is the best way to submit the data from each page instead of SubmitForm.

Hey @Nogueira1306 , I ran into a new issue where the data submits, but it populates on separate lines in my SharePoint database based on the page (page 1 on one line, 2 on the next, etc.)

 

Could you show me what the formula would look like with SubmitForm? That might help to fix it. 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,043)