cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Patch Sharepoint List

Hi,

Im trying to patch a drop down in my sharepoint list and i keep getting an error. 

 

On my first screen i have a list of supplier invoices which on select takes me to another screen with the invoice details in a form. I have a button on the form screen that I want to update the status of the invoice to PAID. 

 

My code is Patch('Supplier Invoices',Gallery1.Selected,{Status:"2"})

 

Any help would be appreciated. 

 

Regards,

Chris

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Barber_Chris 

 

@mdevaney response is accurate.

 

However, I have video that explains Patching various column types of SharePoint that might be handy.

https://www.youtube.com/watch?v=g9ChYuTdNd4

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

View solution in original post

5 REPLIES 5
Super User III
Super User III

@Barber_Chris 

It would be helpful if you could supply the error message.


Also, could you please tell what type of column Status is?  The code to patch a column is dependent on its type. 

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi, 

This is the error.

The STATUS colum is a choice column. Capture.JPG

 

Regards,

Chris

@Barber_Chris 
The 3rd argument of the PATCH function must use this syntax when updating a Choices column

Patch('Supplier Invoices',Gallery1.Selected,{Status: {Value: "2"}})

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi @Barber_Chris 

 

@mdevaney response is accurate.

 

However, I have video that explains Patching various column types of SharePoint that might be handy.

https://www.youtube.com/watch?v=g9ChYuTdNd4

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

View solution in original post

Community Support
Community Support

Hi @Barber_Chris ,

Based on the issue that you mentioned, I agree with @mdevaney 's thought almost. Have you taken a try with solution he provided above?

 

If the Status field is a Choice type column, you should provide a record value for it rather than Text value. The standard format of record value for Choice type column as below:

{
  Value: "Single Option from Choice field"
}

So please modify your Patch formula as below:

Patch(
      'Supplier Invoices',
      LookUp('Supplier Invoices', ID = Gallery1.Selected.ID),  // find the record from your list, which you want to update
     {
       Status: "PAID"   // "PAID" should be an option from the available options of your Status field
     }
)

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (36,101)