cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Power Automate
Power Automate

Patch() Function Not Submitting to SharePoint Online

Are there prerequisites for using the Patch() function with SharePoint (please include SharePoint Online examples on the Power Apps learn references pages)?

 

I'm trying to submit using Patch (there is no EditForm in the app) - and the function is not returning any more errors, but the patch isn't creating a new item in the list on button press. (I am sure it's aware of the data source on SharePoint, because when I had a couple of fields misnamed, it told me to fix them because they didn't exist there. All errors are now fixed.) The dots are scrolling across the top of the UI for a few seconds (around 10 to 15 seconds), and then they stop as if all went well. No error trappable either. I thought it might be related to the site columns, because the other list I patched to was using list columns rather than site columns....however I tested the same function with list columns and it still failed.

 

Are there re-requisites I'm unaware of? Since I keep facing 'surprises' that certain field types are not supported, and unfortunately there is no list of unsupported SharePoint Online fields anywhere; I made every single column on the SharePoint list a "single line text" field, except "notes" which is a "multi-line plain text" field. (Honestly, that's not scalable - but I did it to remove opportunities for failure on submission - alas it hasn't helped.)

 

Thank you in advance for your thoughts.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Automate
Power Automate

Re: Patch() Function Not Submitting to SharePoint Online

After much trial and error (hours), I figured out what the patch statement was not working. In case this matters to anyone else here is what was going on:

 

Well I figured out the problem.

In SharePoint the Title field is defaulted to the name of the list (this is for PowerBI relationships to lists). It is also a HIDDEN field in the default form. So, this works fine on SharePoint, I can add a new item, and the title field populates itself behind the scenes.

HOWEVER, PowerApps does not check this default value, and does not alert us that it NEEDS it (for SharePoint). In any event, just by luck my gut told me to add the "Title" value to the Patch statement, and BINGO Power Apps was finally satisfied. ARGH!

 

Patch(ListName,Defaults(ListName),
{Title: "ListName",
InternalColumnName1: "TextBox1.Text",

InternalColumnName2: "TextBox2.Text",

InternalColumnName3: "TextBox3.Text",

InternalColumnName4: "TextBox4.Text"});
Navigate(BrowseListName, ScreenTransition.Fade)

 

P.S. Remember that Patch() will only take SharePoint "Internal" column names, not display names.

 

View solution in original post

8 REPLIES 8
Highlighted
Power Automate
Power Automate

Re: Patch() Function Not Submitting to SharePoint Online

After much trial and error (hours), I figured out what the patch statement was not working. In case this matters to anyone else here is what was going on:

 

Well I figured out the problem.

In SharePoint the Title field is defaulted to the name of the list (this is for PowerBI relationships to lists). It is also a HIDDEN field in the default form. So, this works fine on SharePoint, I can add a new item, and the title field populates itself behind the scenes.

HOWEVER, PowerApps does not check this default value, and does not alert us that it NEEDS it (for SharePoint). In any event, just by luck my gut told me to add the "Title" value to the Patch statement, and BINGO Power Apps was finally satisfied. ARGH!

 

Patch(ListName,Defaults(ListName),
{Title: "ListName",
InternalColumnName1: "TextBox1.Text",

InternalColumnName2: "TextBox2.Text",

InternalColumnName3: "TextBox3.Text",

InternalColumnName4: "TextBox4.Text"});
Navigate(BrowseListName, ScreenTransition.Fade)

 

P.S. Remember that Patch() will only take SharePoint "Internal" column names, not display names.

 

View solution in original post

Highlighted
Helper II
Helper II

Re: Patch() Function Not Submitting to SharePoint Online

Thank you.

Your posting helped a lot.

Thanks for taking the time

 

 

Highlighted
Community Champion
Community Champion

Re: Patch() Function Not Submitting to SharePoint Online

Hi

 

Just sharing my experience with CDS (CDM) (though I am not familiar with SharePoint).

CDS uses only Field Titles, Not the Display Name.

(So, when one export CDS to Excel, the Title of the Table is Display Name, Not Field TItles;

This is totally different from EXCEL Table created in Cloud, such as Dropbox, OneDrive, where the Field Titles = Display Title)

 

Hence, I assume it applies to the same.

 

Hope this helps others as well.

hpkeong
Highlighted
Frequent Visitor

Re: Patch() Function Not Submitting to SharePoint Online

Thank you soooo much.  Adding to your brilliant explanation (should anyone be wondering): The internal name of a SP list column can be found by going to list settings and clicking the column as if you wanted to modify it; now you can find the internal column name in the address field of your browser, it's the part following the "&Field" argument. 
Highlighted
Advocate V
Advocate V

Re: Patch() Function Not Submitting to SharePoint Online

This worked.  It shouldn't be necessary.  But it worked.

Highlighted
Frequent Visitor

Re: Patch() Function Not Submitting to SharePoint Online

Appreciate you taking the time to figure this out. I had been struggeling on my own for a few days before finding your solution. Thanks again!

Highlighted
Regular Visitor

Re: Patch() Function Not Submitting to SharePoint Online

Thank you for figuring this out and sharing the info! This was driving me nuts!

Highlighted
New Member

Re: Patch() Function Not Submitting to SharePoint Online

This really helped! Thank you!

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (5,401)