Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • Verified answer
    ChrisL58 Profile Picture
    on at
    Re: To Patch or Not to Patch that is the question

    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.

  • mmbr1606 Profile Picture
    12,121 Super User 2025 Season 1 on at
    Re: To Patch or Not to Patch that is the question

    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

  • timl Profile Picture
    34,963 Super User 2025 Season 1 on at
    Re: To Patch or Not to Patch that is the question

    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.

  • ChrisL58 Profile Picture
    on at
    Re: To Patch or Not to Patch that is the question

    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
    34,963 Super User 2025 Season 1 on at
    Re: To Patch or Not to Patch that is the question

    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)

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard