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 to SP list
Power Apps
Suggested Answer

patching to SP list

(0) ShareShare
ReportReport
Posted on by 84
Greetings, I am trying to include a text input control in a edit form control using the patch function. I am able to write to the SP list however, when i select submit, the results are 2 records being submitted, one with the data from the edit form control, then another from the input control. I think my issue is using the semi colon but i am not quite sure. Any help is appreciated.
 
Categories:
I have the same question (0)
  • Suggested answer
    CU25020938-0 Profile Picture
    71 on at
    That's because you are creating two line items. The submitform creates an item, and you use the Patch to also create an item. You need to refer to the already created item in the Patch function.
     
    Put this into the form OnSuccess property:
     
    Patch(
                    'VHR_In Office Calendar (testing)',
                    LookUp(
                        'VHR_In Office Calendar (testing)',
                        ID = Self.LastSubmit.ID
                    ),
                    {AdditionalNotes:AdditionalNotes.Text}
                )


    Or if you add a Text column in the SP list called Additional Notes and add that datacard to the form
    ​​​​​​​you don't need an extra Patch at all.
  • Suggested answer
    Pstork1 Profile Picture
    69,397 Most Valuable Professional on at
    If you want to do a separate Patch to the record that is in the Edit form then you need to use a Lookup() or the LastSubmit property of the form to specify the record to be patched.  Something like this
    SubmitForm(InOfficeCalendar); Patch('VHR_In Office Calendar (testing)', InOfficeCalendar.LastSubmit, {AdditionalNotes: AdditionalNotes.Text}); Reset(AdditionalNotes);
  • Blue87 Profile Picture
    84 on at
    thank you for your response, i received the below errors. could you explain a little on what the "ID = self.lastsubmit.ID" is used for? Thank you 
  • CU25020938-0 Profile Picture
    71 on at
    LastSubmit , capital letters matter and you can only use LastSubmit in the OnSuccess property of the form.
     
    LastSubmit can access properties of the last submitted record that were created by SubmitForm(). E.G. Self.LastSubmit.Location will give you the text from the Location column.
     
    Also, is there a reason you want to separately submit the additional notes? If you click on the form on the properties side window there is a button called Fields.
    You can then select the additional notes field that is already on the SP list and simply add it to the form. Then you can disregard the Patch part, because the submitform will submit all fields:
     
  • Pstork1 Profile Picture
    69,397 Most Valuable Professional on at
     @Kenobi  said, "you can only use LastSubmit in the OnSuccess property of the form"
     
    That is not true. LastSubmit can be used in a variety of places outside the OnSuccess. It is most commonly used in OnSuccess, but is a perfect solution here where the SubmitForm() is in the same action as the use of LastSubmit.
  • CU25020938-0 Profile Picture
    71 on at
    Pstork1 yes that is true, i usually use it on the OnSuccess to make sure nothing gets messed up if for any reason the form wouldn't submit. 

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 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard