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 / Trouble with Patch Fun...
Power Apps
Answered

Trouble with Patch Function Changing Status in Power Apps Form Connected to SharePoint

(0) ShareShare
ReportReport
Posted on by 32

Hi everyone,

I'm currently developing an app using Power Apps, where I've set up a status filter to manage requests with statuses "New," "Pending," and "Completed." These requests are displayed in a gallery, and I can update their status using a form that patches changes back to a SharePoint list.

I'm able to change the status from "New" to either "Pending" or "Completed" without any issues. However, I encounter problems when I try to change a status from "Pending" to "Completed." Whenever I attempt this, I often receive an error: "An error occurred on the server." Interestingly, I also face similar issues when trying to change from "Completed" back to "Pending" or "New," and from "Pending" to "New."

Could anyone shed some light on why this error might be occurring only with certain status transitions? Any insights or solutions would be greatly appreciated!

Thank you!

 

PS. The code I am using is: for the form, onsuccess: 

Patch(tracker, 

         lookup(tracker, ID= Gallery.selected.ID),

{         Vendor:{Value:vendorcombobox.selected.Value},

          Rerquest_Status (Value:requeststatus.combo.Selected.Value} })

 

 

 

Categories:
I have the same question (0)
  • SebS Profile Picture
    4,822 Super User 2026 Season 1 on at

    @JOYCEJ 

     

    Is lookup(tracker, ID= Gallery.selected.ID) not throwing you an error ? it should be LookUp(tracker, ID = Gallery.Selected.ID) and Vendor:{Value:vendorcombobox.selected.Value} should be Vendor:{Value:vendorcombobox.Selected.Value} 

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Hi @JOYCEJ 

     

    It depends if the Rerquest_Status (is that a typo?) column in SP is a choice column or a text column.

    Also, there's some things wrong with the patch e.g.
    E.g. this line is wrong

    Rerquest_Status (Value:requeststatus.combo.Selected.Value

     

    It should be:

    ColumnName: ControlName.Selected.Value

     

    So something like:

    Rerquest_Status: requeststatuscombo.Selected.Value
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @JOYCEJ,

    The key to your issue maybe the place you write the Patch() function.

    OnSuccess property maybe not the correct property you should set the Patch() function.

     

    Not sure if your edit form has Edit as the Default Mode, however, I want to explain to you that Edit For will be revert to the default mode once it is submitted successfully.

    So how you set the default value of the combobox decides if you could capture the selected value after submission.

  • JOYCEJ Profile Picture
    32 on at

    Hi Sebs5, the code was correct in my powerapps. When I type it here it was messy. 

  • JOYCEJ Profile Picture
    32 on at

    Thank you, I have solved the problem in a different way...

  • JOYCEJ Profile Picture
    32 on at

    Hi Everyone, thank you for your replies!

    I solved the problem by deleting these two combo boxes I added to the form. Instead, I used the form data fields. And made sure the data fields are attached to the data card. So I don't need to use Patch() function and submit function at the same time.  

    I think when I use Patch() and Submitform function at the same time, it often throws me problems. 

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 Launch!

Jump in, show your community spirit, and win prizes!

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 432

#2
Valantis Profile Picture

Valantis 362

#3
timl Profile Picture

timl 337 Super User 2026 Season 1

Last 30 days Overall leaderboard