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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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
    37,248 Super User 2026 Season 1 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
    37,248 Super User 2026 Season 1 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,629 Super User 2026 Season 1 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard