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 / Using Patch function t...
Power Apps
Unanswered

Using Patch function to update a field using the OnSelect on a button

(0) ShareShare
ReportReport
Posted on by 26

Good afternoon.  I have a PowerApps based on a SharePoint list. On an Edit form there are multiple fields. One field is the employees photo they upload and another is the 'Status' of that photo after administration has reviewed the photo. I am needing a way for the 'Status' field to be auto updated to "Pending" when the user uploads a new photo. I was thinking this could be on the OnChange for the photo or even a button that triggers the update and then saves any changes.  I have played with the Patch function on the button but it isn't working: 

Patch('EmployeeList',LookUp('EmployeeList',Status="Approved","Pending","Removed"),{"Pending"})
 
Any ideas on how to get this to work, I am still pretty green with Power Apps...
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    Hi @CTJohnson ,

    If you simply want the Status of the current record to be updated to Pending

    Patch(
     'EmployeeList',
     ThisItem,
     {Status: "Pending"}
    )

    If Status is a Choice field, you will need Status.Value

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • CTJohnson Profile Picture
    26 on at

    Warren, where do I set that? on the photo field or on a buttons OnSelect property?

  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    @CTJohnson ,

    A button inside the form would do the job.

  • CTJohnson Profile Picture
    26 on at

    I'm missing something here I think. So I added a button and the OnSelect is set to:

    Patch('EmployeeList',ThisItem.Status.Value,{Status: "Pending"})
     
    It's not working and has the red squiggly lines under it. 
  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    @CTJohnson ,

    if Status is a choice column

    Patch(
     'EmployeeList',
     ThisItem,
     {Status: {Value: "Pending"}}
    )

     

  • CTJohnson Profile Picture
    26 on at

    Yes, Status is a choice column. I am still getting the red lines under it. When entering it in the function line, it doesn't have the 'picker' to choose ThisItem, Any ideas?

  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    @CTJohnson ,

    I only used ThisItem as I assumed you were using a Form. How are you choosing which record to work on presently ?

  • CTJohnson Profile Picture
    26 on at

    I am using an Edit form that comes from a selected item from a gallery list.

  • Verified answer
    WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    @CTJohnson ,

    So I assume the button is not on the Form. If you select the record from a Gallery, then

    Patch(
     'EmployeeList',
     {
     ID: GalleryName.Selected.ID,
     Status: {Value: "Pending"}
     }
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • CTJohnson Profile Picture
    26 on at

    Warren, that worked!!!! Thank you so much!  I do have one more obstacle that I will post dealing with how to capture and store a lookup column into a text field. 

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard