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 / Network Error when usi...
Power Apps
Unanswered

Network Error when using Patch function: The requested operation is invalid

(0) ShareShare
ReportReport
Posted on by 9

I'm getting an error when patching a SharePoint list from a PowerApp with little to no information to work off of. The only message is "Network Error when using Patch function: The requested operation is invalid". I dug into the Error object and found a code of 8, which I believe corresponds to ErrorKind.ConstraintViolation (One or more constraints have been violated).

 

I have narrowed down the error to a multiple-select Person or Group column in my SharePoint list called "Operators". When I comment that column out, the Patch is successful. When it's included, I get the error above. The worst part is, I have successfully patched to a Person or Group column in a different SharePoint list, but this one fails.

 

Column settings:

shoeheart_0-1637102851350.png

 

My code that is failing:

 

Patch(
 'SharePoint List Name',
 Defaults('SharePoint List Name'),
 {
 Title: "Title",
 Zone: {Value: sel_sh_zone_name},
 Shift: {Value: sel_shift_name},
 Line: {Value: sel_line_name},
 Date: DateValue(DateDisplay_Component_12.datasource),
 Operators: AddColumns(
 operators_select.SelectedItems,
 "Claims",
 "i:0#.f|membership|" & Mail,
 "Email",
 Mail,
 "Picture",
 "https://<base_site_url>/_layouts/15/UserPhoto.aspx?Size=L&AccountName=" & Mail
 )
 }
 )

 

 

The operators_select.SelectedItems is a Office365Users table. I need to add the "Claims", "Email", and "Picture" columns in order to avoid Table schema errors. Before attempting the Patch, no errors/warnings show up. Like I said, this strategy has worked successfully in another SharePoint list with this column type. I've scoured settings and haven't found any differences yet.

 

If anyone has any ideas for what to look at next or how to get more detail on the error message, please let me know! Thanks.

 

I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    Hi @shoeheart ,

     

    Please make sure that the 'Mail' column of each record has a value rather than blank.

    vxiaochenmsft_0-1637304919682.png

     

    In addition ,you could use ""

    instead of 

    "https://<base_site_url>/_layouts/15/UserPhoto.aspx?Size=L&AccountName=" & Mail

     

    Best Regards,

    Wearsky

     

  • shoeheart Profile Picture
    9 on at

    Hi @v-xiaochen-msft,

     

    Thank you for the input. You are spot-on with the "Mail" column needing a value. I did a bunch of manual testing and found that it when it was missing, I got the error. I also saw that the Picture field did not throw an error if it was just passed an empty string.

     

    However, the reason it is not there is confusing. In one set of code, I Patch successfully to the first list because the Mail field is included in the records of "operators_select.SelectedItems". However, the Mail field disappears from the records before the second Patch.

     

    I worked around this by setting a variable to collect this section into a Table:

     

    Operators: AddColumns(
     operators_select.SelectedItems,
     "Claims",
     "i:0#.f|membership|" & Mail,
     "Email",
     Mail,
     "Picture",
     "https://<base_site_url>/_layouts/15/UserPhoto.aspx?Size=L&AccountName=" & Mail
     )

     

    I then passed the Table variance to both Patch functions and it worked. But, the Mail field is still deleted from the operators_select.SelectedItems, so I have to ask the user to re-add selections to the combobox if they want to make any edits.

     

  • shoeheart Profile Picture
    9 on at

    I am going to mark this one as correct because it fixed the issue at hand, though it revealed what I think the root of the problem is.

     

    Short version - the error message was caused by the request being sent without the Mail field populated. This is required for SharePoint to know what Person it is.

     

    Longer version - for my app, I found out that when I perform a Patch, most of the data on the Person objects in my Combobox seems to "disappear" from the objects. The only ones that remained were unhelpful. I worked around this by building a Person object on a variable and sending that one to two different Patches. In my previous setup, the first Patch was successful, but the data was somehow deleted in between the two Patches. Very strange.

  • Community Power Platform Member Profile Picture
    on at

    @v-xiaochen-msft sorry this is random, but I am facing a similar issue. I am new to powerapps and would appreciate if you could explain about -"'Mail' column of each record has a value rather than blank." I did not quite understand. Thanks.

  • natalia10 Profile Picture
    44 on at

    Halo, 

     

    i am having this error , but a bit different.

    anyone can help me please. 

    so i click my check all button then i transfer my data , my transfer button contain Patch in it. Previously is working so im not sure why suddenly is not working.

     

    Many thanks

  • Community Power Platform Member Profile Picture
    on at

    I need help, I am getting the same Network error on the Patch function

  • Zarayuvi Profile Picture
    4 on at

    If you are using Submit Form(Sharepoint1) and getting the error :Network Patch using title column

    Then make sure you go to List Setting->Advanced settings->Allow Management of Content Types ->Yes (by default it will be No)

    Go back to settings->Column title -> Remove the required information to No

    Once done with changes go to Powerapps and refresh the Sharepoint source

  • Rosheen Profile Picture
    2 on at

    This error occurred when I'm trying to make a checkout.

    Rosheen_0-1689465654182.png

     

    I also want to know how to create relation between tables. Please help me in these issues

  • KellyKash Profile Picture
    2 on at

    Hello, I am having the same issue. 

     

    I’m trying to use a Patch() function to collect some data (product name, price and quantity) from my shopping cart gallery and then populate a product order table in Dataverse. 

     

    Patch function:

    ForAll(ShoppingCartGallery_1.AllItems,Patch('Product Orders',Defaults('Product Orders'),{'Product Name':ThisRecord.Item.ProductName, 'List Price':Value(ThisRecord.Price),Quantity:Value(ThisRecord.QuantityTextInput_1.Text)}))

  • RobertLim Profile Picture
    12 on at

    What are possible reasons of "Network Error when using Patch function: The requested operation is invalid"?

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard