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 / Patching - Submit button
Power Apps
Answered

Patching - Submit button

(0) ShareShare
ReportReport
Posted on by 110

After Fixing the errors in code, Upon using the "submit" button in my app, I am prompted with this error in PowerApps

 

jamesmdc1_0-1682735365882.png

 

jamesmdc1_1-1682735414005.png

 

Code for the "submit" button 

 

 

Patch('Disciplinary Forms',Defaults('Disciplinary Forms'),{'Date Of Occurrence':DataCardValue4.SelectedDate,'Employee Name':DataCardValue2.Text,'Shift':DataCardValue3.Selected,'Reason For Discipline':DataCardValue5.Selected, 'Explanation':DataCardValue6.Text,'Machine Crash':DataCardValue7.Value,'Machine ID':DataCardValue8.Text,'Require Training':DataCardValue9.Value,'Action Taken':DataCardValue10.Selected,'Additional Notes':DataCardValue11.Text,'Employee Signature':DataCardValue12.Text,'Supervisor Signature':DataCardValue13.Text,'Operations Manager Signature':DataCardValue14.Text,'Human Resources Signature':DataCardValue15.Text});

If(!IsEmpty(Errors('Disciplinary Forms')),Notify(Concat(Errors('Disciplinary Forms'),First(Errors('Disciplinary Forms')).Message & " " & Column),NotificationType.Error),Notify("Record Saved Successfully",NotificationType.Success))

 

 

 

Data not landing in Sharepoint. 

 

jamesmdc1_2-1682735693522.png

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,378 Most Valuable Professional on at

    Hi @jamesmdc1 ,

    Firstly I have to assume: -

    • You are getting no errors (red cross) on the formula itself
    • You have no Required fields you are not writing to
    • Permissions are correct
    • You have made several attempts, after saving and re-opening to ensure it is not a temporary connection issue.

    The next things to check are the field types - from your code, I assume: -

    • Date Of Occurrence': Date/Time
    • 'Employee Name': Text
    • 'Shift': Choice ?
    • 'Reason For Discipline': Choice ?
    • 'Explanation': Text
    • 'Machine Crash': Yes/No ?
    • 'Machine ID': Text
    • 'Require Training': Yes/No ?
    • 'Action Taken': Choice ?
    • 'Additional Notes': Text
    • 'Employee Signature': Text
    • 'Supervisor Signature': Text
    • 'Operations Manager Signature': Text
    • 'Human Resources Signature': Text

     

  • jamesmdc1 Profile Picture
    110 on at

    Hello @WarrenBelz 

     Thank you for the detailed response. Both assumptions are accurate. I’ll get better at posting, my apologies for the lack of details. 

    • no errors in the formula 
    • all fields are filled; some required 
    • permissions are okay
    • Ive been tinkering a few hours now and taking a break 

    field types

    • correct

     

     

    Appreciate your time and feedback. I’m new to the PowerApps world and I suspect I’m missing something. I will post back any changes/advancements tomorrow. Next up, PDF functionality, approvals and Mail and maybe even signatures. Really excited about all the possibilities within powerapps. 

    thanks! 

  • WarrenBelz Profile Picture
    155,378 Most Valuable Professional on at

    Hi @jamesmdc1 ,

    OK - the next question is have you changed the Items of any of the Combo Boxes containing the Choice columns from the standard Choices(@ListName].FieldName) ? If so, which ones and what to ?

  • jamesmdc1 Profile Picture
    110 on at

    Hello @WarrenBelz 

     

    All Fields were pulled in from the Sharepoint site. All Fields have been have been set to false for required. Same network error today. 

     

    Choices([@'Disciplinary Forms'].'Shift')

    Default - ThisItem.Shift

    Choices([@'Disciplinary Forms'].'Reason For Discipline')

    Default - ThisItem.'Reason For Discipline'

    Choices([@'Disciplinary Forms'].'Action Taken')

    Default - ThisItem.'Action Taken'

     

    jamesmdc1_0-1682782355660.png

    jamesmdc1_1-1682782430099.png

     

     

     

  • leonsig93 Profile Picture
    229 on at

    Hey not sure if related, but one of the reasons I get this issue is when I have an SPO field that is marked as required within SharePoint itself.

     

    I noticed you are using a form so when you said you marked them as not required, did you mean within each Datacard in the PowerApps form?

     

    If so, that only works if you use the SubmitForm function. Using Patch you ignore anything you did with the datacards since you end up referring directly to the input controls. Try adding another button and use the SubmitForm function and see if you run into the same problem.

     

    So the OnSelect ends up being SubmitForm(yourFormName)

     

    Just make sure that if you didn't include any other required fields within the form, you add them back in and mark their required property as false, then you can make them invisible so they don't interfere with your form.

  • Verified answer
    WarrenBelz Profile Picture
    155,378 Most Valuable Professional on at

    Hi @jamesmdc1 ,

    OK - the next thing is some basic debugging - delete all the fields patches and put them back in one at a time until you get the error.

  • jamesmdc1 Profile Picture
    110 on at

    Hello @leonsig93 Thanks for the Response! Appreciate the comment as this detail could be easily missed. I validated none of the sharepoint columns were set to required and likewise within the apps datacards. Upon adding a second button SubmitForm(FormName) and testing I receive both the same error and no data in sharepoint. Alternatively I tried (below) with the same results, no data w/ network error. 

    Button2.OnSelect = SubmitForm(Form1)
    Button2.OnSelect = SubmitForm(FormName) 

    jamesmdc1_0-1682830778533.png

     

    @WarrenBelz I think this is my only option left. Start with the choice columns an yes/no sliders. Work my backward until I find the problem. 

     

    Thanks All

  • leonsig93 Profile Picture
    229 on at

    The other thing you could try is adding a new form and do nothing to it except add a button with the SubmitForm function with the new forms name. Fill out the data and see if there is still an issue when using the unmodified form. If the new form submits without an issue, you could then compare your original form and the new form to see what differences might exist. Might help narrow it down a bit.

     

    You could also open the Monitor and see if that provides any additional insights. Does come in handy sometimes, but it might just give you the same error information.

    https://learn.microsoft.com/en-us/power-apps/maker/monitor-canvasapps 

  • jamesmdc1 Profile Picture
    110 on at

    @leonsig93 Thanks Again! The result? 4 Errors from the submit button. 

    jamesmdc1_0-1682875731678.png

    jamesmdc1_1-1682875750263.png

    jamesmdc1_2-1682875781420.png

    jamesmdc1_3-1682875833006.png

     

  • jamesmdc1 Profile Picture
    110 on at

    @WarrenBelz @leonsig93 Hello All, I was able to fix this weird patching issue by trial and error. Just kept removing items and code until I said "nuke it" and started fresh. Built this time directly from sharepoint using the integrate option. I appreciate both of your time you lent me and appreciate your troubleshooting methods. 

     

    Form fully functional. Added a pdf option and don't really have much of a flow beyond that. I added the PDF feature and while it does take a PDF of the form and lands in SharePoint, its an extra step. I was wondering if I can build that function into my submit button as well and also have it emailed. I am opening up a new post as this is completed, thanks again. 

     

    Submit button - 

    SubmitForm(SharePointForm1);Navigate(SuccessScreen,ScreenTransition.Fade);

     

    Pdf Button (onSelect) 

    PDFfromEDF.Run({file:{name:"EmployeeDisciplinaryForm.pdf", contentBytes: PDF(FormScreen1,{ExpandContainers:true})}})

     

    Two flows for this process

    1.) PDF from EDF

    jamesmdc1_1-1683058496616.png

    And a Second for the report itself. (assuming I can combine the two)

    2.)Employee Disciplinary Report

    jamesmdc1_2-1683058574181.png

     

     

    Thoughts on how to do this? A flow or video you recommend to complete this? 

    Thanks guys

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard