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 / SubmitForm has stopped...
Power Apps
Answered

SubmitForm has stopped working

(0) ShareShare
ReportReport
Posted on by

So I have an app that has been working well for a while, and all of a sudden the SubmitForm(Form2) in OnSelect property has stopped working. It's a complex form that I will try to explain, including what I've tried already. Hoping someone might have another idea.

 

DataSource = SharePoint list

The app has two form screens with many fields of different types: text entry, directory drop-down, multi-select, Yes/No, etc. 

 Screen 1 = form with default Edit mode where employee fills out and submits information. SubmitForm(Form1) continues to work OnSelect.

 Screen 2 = form with default view mode where supervisor reviews employee's entry then clicks an edit button to make comments and "sign" their name by picking from a directory list drop-down list. This SubmitForm(Form2) was working to update the SharePoint list item and then just stopped. No errors or other clues as to why it has stopped working. OnSuccess for the form holds the navigation and reset form commands, so when the submit button is selected, just nothing happens as it is not successful. 

 

Notes - we are using Power Automate to send the supervisor an email when an employee submits a new form. This email contains a deep link that takes the supervisor directly to Form2 to view the record. We are not using a gallery at all as the information is confidential and we don't want anyone to be able to look up other people's entries. The only other code I have in the OnSelect property is     Set(varSecureID, Blank())    as relates to the ID we are using for deep linking. Removing this code does nothing.

 

If I'm honest, the Patch function completely confuses me. And without a gallery, I'm not sure if it can be done. Besides that, it's possibly more than just the two fields the supervisor might update on the form. They could add commentary anywhere in the form, so a patch function would need to update any field - of which there are many.

 

Hoping someone can save my bacon! Happy to send screenshots if it is helpful.

Categories:
I have the same question (0)
  • ahartsfield Profile Picture
    on at

    Possible progress? I got a Patch function to sort of work. In the OnSelect property, I removed the SubmitForm(Form2) and replaced it with:

     

    Patch('DataSource', Defaults('DataSource'),
    Form2.Updates)

     

    It was successful at writing to the SharePoint list, but rather than update the list item that was already there, it made a whole new entry. So I need to figure out why it's doing that.

  • Verified answer
    v-mengmli-msft Profile Picture
    on at

    Hi @ahartsfield ,

     

    If you use default in a patch this will default to creating a new record for the data source. If you want to update the original record in the data source through a form, you can do this:

    SubmitForm(Form)

    If you want to use a patch to update a record, you want to first use a lookup to find the record in the data source.

    Patch(DataSource,LookUp(DataSource,ID=XXX.Value),Form.Updates)

    vmengmlimsft_0-1694669448101.png

     

    Hope this helps you!

    -------------------------------------------------------------------------------------------------------------------------------

    If my answer solves your problem, please accept it as a solution to help more people stuck on the same problem find it.

     

    Best regards,

    Rimmon Li

     

  • ahartsfield Profile Picture
    on at

    Thank you @v-mengmli-msft 

    SubmitForm(Form) used to work, but it stopped working, which is why I'm trying to use the Patch function. I don't have a gallery in my app. Will the patch code you show still work without a gallery to reference?

  • ahartsfield Profile Picture
    on at

    @v-mengmli-msft I got it to work with the formula you gave above! We have a unique identifier for each record and I was able to use it to lookup directly in the data source.

     

    Patch('DataSource', LookUp('DataSource',IDColumnName=varSecureID),Form.Updates);

    Thank you for your help!

  • kiki_515 Profile Picture
    14 on at

    I encountered same issue here, the patch function is work for update the existing record but it's not user friendly on the required field checking, it'll not stop the form submit even the required field does not fill up. And even though we can use the logics <if !blank>to check the field but it's not convinced if there are multiple different conditions of the required file.

  • ahartsfield Profile Picture
    on at

    This is more of a workaround, but something I did on my form was in the DisplayMode property of the Submit button, I used this code so that the button isn't clickable until the required fields are filled:

    If(FORM-NAME.Valid,DisplayMode.Edit,DisplayMode.Disabled)

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard