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 / Patch and SubmitForm i...
Power Apps
Answered

Patch and SubmitForm in the same button

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 


I am using patch to create a data that is to generate a unique ID for each of my entry.

 

// Update ticket number
UpdateContext({item_newTicket: Patch(Ticket, item_newTicket, {'Ticket No.':Text(item_newTicket.ID,"[$-en-US]000000")})});

 

 

and here is to update/save the status for the entry:

 

//Update ticket status and assign PIC
UpdateContext({item_newTicket: Patch(Ticket, Defaults(Ticket),{PIC:LookUp('Sub Category',ID=ddlSubCategory.Selected.Id).PIC,Substatus:LookUp(Choices(Ticket.Status),Value="New"),Status:LookUp(Choices(Ticket.Status),Value="Open")})});

 



At first, I figured to just patch all of the input fields but I realized Attachments is not supported in Patch function. So now I have to use submitForm but in order to create a ticket ID is to use patch.


Is it possible to submit and patch with only one button? I tried it but unfortunately it creates double entries in my SP list. And none of the patch fields is showing up.


Really appreciate if anyone can help me and thank you.. 🙂

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @Anonymous ,

    There is only one way of Patching attachments - that is to use

    Patch(
     YourListName,
     Defaults(YourListName),
     YourFormName.Updates
    )

    however this would probably not allow all the other things you want to do in the Patch.

    You can however Patch on the OnSuccess of the form that is submitted

    Patch(
     YourListName,
     {ID:Self.LastSubmit.ID},
     {Your Patch here . . .}
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I figured out the issue and turns out using a combination of Patch in onSuccess with Self.LastSubmit.ID is a better option. Thank you for the help! 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard