Welcome to my mini-guide on using the Power Apps Patch Function with SharePoint.
Inside you will find examples of how to patch every SharePoint column type. Each page contains code and visuals to show what the code is doing. COPY + PASTE code from the guide into your own app. Just change the datasource name and column names to match your own.
Power Apps Patch function examples by SharePoint column type:
- PATCH A SharePoint Single Line Text Column
- PATCH A SharePoint Multiple Line Text Column
- PATCH A SharePoint Number Column
- PATCH A SharePoint Yes/No Column
- PATCH A SharePoint Person Column
- PATCH A SharePoint Person Column With Multiple Values
- PATCH A SharePoint Date Column
- PATCH A SharePoint Date & Time Column
- PATCH A SharePoint Choices Column
- PATCH A SharePoint Choices Column With Multiple Values
- PATCH A SharePoint Lookup Column
- PATCH A SharePoint Image Column
- PATCH A SharePoint Hyperlink Column
- PATCH A SharePoint Currency Column
- PATCH A SharePoint Task Outcome Column
There is no way to PATCH these column types:
- Calculated Column
- External Data Column
- Location Column
Did You Enjoy This Article? 😺
Subscribe to get new Power Apps articles sent to your inbox each week for FREE
Questions?
If you have any questions or feedback about Power Apps Patch Function Examples For Every SharePoint Column Type please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.
Hi Matt,
Thanks to this tutorial I just patched to a lookup column for the first time! Next, I’m wondering if it is possible to collect to a lookup column when collecting a whole collection to a datasource (eg. Collect(Datasource, Collection)
Is it possible?
Hi Matt,
Thanks for the article. Can you please share how to work and store Managed Meta data columns using Power apps.
Sudheer,
Suggest you check out this page by my friend Reza Dorrani: https://rezadorrani.com/index.php/2020/05/04/power-apps-patch-function-with-sharepoint/
Can you please share tips on how to patch gallery selection that has a nested gallery?
Kiki,
I would suggest you ask this question in the Power Apps forums:
https://powerusers.microsoft.com/t5/Forums/ct-p/PA_Comm_Forums
Hi Matt
Thank you for this invaluable resource that helped and developed my knowledge.
I’m stuck when it comes to merging two collections, from two Sharepoint lists that contain students’ test results. It’s about how I handle columns with the same name. The key is upn, but then there are also the students’ names, school and class.
Dropcolumns, showcolumns?
Hello Ola,
Check out this page from my “Collections Cookbook.”
https://www.matthewdevaney.com/powerapps-collections-cookbook/join-all-columns-from-another-collection/
Hi, is there a way to change the First Published Date for News?
We are transferring lots of News to a new Sharepoint and we want them to have the correct Publish date but this not editable.
Thanks
Stefan,
Not sure. SharePoint migrations are not my specialty.
Good Evening @Matthew
Thanks for the write up tell me how would i go about adding a event created to a outlook calendar?
Justin,
To create a new event in Outlook you would have to use the “Create Event” action in the Office365Outlook connector. This is not done using the PATCH function.
Link: https://docs.microsoft.com/en-us/connectors/office365/#create-event-(v4)
“PATCH A SharePoint Image Column” seems incomplete or just does not work. Do you have any pointers or further explanation on that solution?
Sean,
I agree it seems like I stopped short of a working solution. What does the Update property of the card for the Attachments column say? Can you point it at the control like this?
AttachmentsControlName.Attachments
Now give me the same list for those of us who might be using Dataverse! 😂
Ho do I patch a lookup column to my sharepoint list. Not the lookup’d column itself. I have a main SPList with lookup columns. I populated dropdowns with the secondary lists (because I can’t sort lookup column directly). Now I want to patch my selected choice (from the secondary list) into my main list, but this gives an error since the data types don’t match.
StefWS,
The data types must match if you are patching from one SP list to another. I don’t think there’s any way around that. Why not just store it as plain-text and sort on it instead?
I’m struggling with patching a Person column, I’ve always used the formula you list out in your Patch the SharePoint Person column page and it has always worked flawlessly, but now I have an application I am building where it just simply will not work, and I cannot work out why. I get the error “Missing column. Your formula is missing a column ‘Email’ with a type of ‘Text’. (which it is not, this exact formula works if I copy paste it into another application that does this same patch function)
Any ideas?
Brock,
If it’s always worked flawlessly for you in the past, I wonder if there is currently a Power Apps bug?
Also, what code did you use to try and patch. Can you give an example?
Just wondering how to trap an error if the column is set to “Enforce Unique Values” –
Brian,
You could trap the error using Patch function error handling techniques like the one explained in my coding standards.
https://www.matthewdevaney.com/power-apps-coding-standards-for-canvas-apps/power-apps-error-handling-guidelines/#Patch-Function-Error-Handling
Hi Matt, I’m kind of stuck – I’m trying do calculations on the Total Field (type: number) – what I’m trying to achieve is Sum of all subject on the Total Field. When I patch only the Total Filed calculated value doesn’t get patched.
Note: I have grid like experience so that on one go we can enter values for multiple students and I’m storing everything inside a collection and then patching collection to the SP list on click of a button
Aamir,
Check out my tutorial on how to create a Power Apps Timesheet App. It demonstrates how to SUM the result of several fields using a calculated field.
https://www.matthewdevaney.com/make-a-power-apps-timesheets-app-part-1/
Hi Matt,
I would like to patch the name of a File via PowerApps to a SharePoint Library, is there some special trick?, just getting errors that the data i’m trying to change is read only, althougt its not read only.
Hi Matt, my patch function does not work, it is still patching even the SP column is set to required.
Nani,
Your message does not give enough information to troubleshooting.
Hi Matt,
Good day!
I have an PowerApp that uses SPO List as a backend, I set some columns on the list to be required. Then on the PowerApps I used the patch function to save it to the list, however even the the control (txtVendor.Text) is empty the Patch Function still save it to the list. I’m trying to catch the error using the artcile you have shared Power Apps Patch Function Error Handling – Matthew Devaney.
Hi Matt,
Always enjoy your blogs, super helpful. I have a SharePoint list that has more than 70 fields. To patch the list, I know I will need to patch all items one by one. If I use submit form, I can submit it in one click but it has its drawback. Is there a faster way to Patch a long SharePoint list?
Jay,
Check out this article for the fastest PATCH method:
https://www.matthewdevaney.com/patch-multiple-records-in-power-apps-10x-faster/
How to patch a dependent dropdown field?
Amir,
The same way as any other dropdown field.
You are amazing Matthew, thanks so much! This is extremely helpful to understand how to structure my data types for a custom list patch.
You don’t have how to patch to an “Attachments” column.
Shawn,
Unfortunately, attachments cannot be updated with the PATCH function.
Matt – this is great! Unfortunately I have two scenarios not covered here – and please understand that I am very new to Power Apps. I have data stored in both variables and in labels. Are there any changes in syntax if patching directly from variables or in using the label control instead of the text input control?
Thank you!
Allison,
No, there are not any changes in syntax for label or variable.
Can we use patch to create an instance of a dataset in a document library?
Hi Matt! I am stuck and have searched all over and am not sure what I’m doing wrong. I have a Sharepoint list that stores data upon entry in PowerApps, one of the columns is a person column. I want it to then Patch to a different Sharepoint List that then stores the back and forth approval data for that record based on it’s ID# (Parent ID#). I am stuck trying to get the details from the person column to translate into the sharepoint list. The other columns will populate on the list, that one will not. This is what I have.
Set(varTimeOffRecord, TimeOffForm.LastSubmit);
Patch(TimeOffAppovalslist, Defaults(TimeOffAppovalslist), {
Title: “Testing Patch”,
APPROVERNAME: cmbClinicApprover.Selected.DisplayName,
Outcome: “Pending”,
ParentID:TimeOffForm.LastSubmit.ID
});
From what I’ve found I’ve gathered I need some way to translate the data in my combo box so that the child sharepoint list can grab that data.
Something like this
but when i try to add that in, it doesn’t seem to work and just makes it angry.