web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / To Patch or Not to Pat...
Power Apps
Unanswered

To Patch or Not to Patch that is the question

(0) ShareShare
ReportReport
Posted on by

Hello,
I have an edit form that is also acting as a new form.
What I want to do is add a new record using the SubmitForm(<formName>) function for both the new form and the edit form.
Can I do what this or do I need to use the Patch function?
I tried using the Submit Form function, but it wouldn't save the form data.

Categories:
I have the same question (0)
  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @ChrisL58

    Are you saying that your edit form works when editing a record but doesn't work when adding a new record?

    If that's the case, are you calling the NewForm function prior to addig a new record?

    NewForm(YourForm)
  • ChrisL58 Profile Picture
    on at

    No, the default form mode is Edit but I have some logic where I change the mode so that the form opens up as a new form. 

    ResetForm('Broker Fee Request Form_Edit');NewForm('Broker Fee Request Form_Edit')

    I have a save buttons to add a new record in a popup and I have another popup to save a record that has been edited and askes the user to confirm whether or not to save or update the record
     
    Save New OnSelect property is: 
    SubmitForm('Broker Fee Request Form_Edit');Set(varShowAdd,false);Reset(txtSearchBox)

    Save Edit OnSelect property is: 
    SubmitForm('Broker Fee Request Form_Edit');Set(varShowEdit,false);Reset(txtSearchBox)
     
    When I attempt to save a new record, nothing happens and I am not sure if my current design is good or not.
  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @ChrisL58 

    The formula that you posted looks ok to me. I'd suggest that you run the Monitor tool to see if that discloses any more detail as to why adding a new record fails. Perhaps the form is missing some mandatory value that's required for a new record, or there may be some other server validation failure.

  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    hey @ChrisL58 

     

    maybe this video also helps:

    Power Apps Gallery Edit Form Tutorial for Beginners (youtube.com)

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • Verified answer
    ChrisL58 Profile Picture
    on at

    Due to the nature of the data being collected the Submit Form property wasn't the right choice so I needed to write a patch statement, which worked for me.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard