1

I have a code that using to update the SharePoint list fields. the problem is the size of the request message that exceed 2097152 byte.I know Microsoft introduce a new approach in order to solve the problem but it is used for upload large file not for large request message.

My code is C# code as follow:

//Starting with ClientContext, the constructor requires a URL to the 
// server running SharePoint. 
   ClientContext context = new ClientContext("http://SiteUrl"); 

// Assume that the web has a list named "Announcements". 
   List announcementsList = context.Web.Lists.GetByTitle("Announcements"); 

// Assume there is a list item with ID=1. 
  ListItem listItem = announcementsList.GetItemById(1); 

// Write a new value to the Body field of the Announcement item.
listItem["TestField1"] = "This is my new value!!"; 
listItem["TestField2"] = "BigData1"; 
listItem["TestField3"] = "BigData12"; 
listItem["TestField5"] = "BigData3"; 
listItem["TestField6"] = "BigData4"; 

listItem.Update(); 

context.ExecuteQuery(); 

the problem the values of my fields is very big and I can not reduce it. I have tried store each of fields in separate connection, but I faced a performance issue and some of fields is large(i.e the size of data that I want to store in TestField1 is large 2097152 .

it doesn't matter if the solution using javascript or C#

Thanks

4
  • 2097152 of what? Characters or Bytes? I think you are hitting the limitations for SP. Not sure SP Online but SP 2016 can have only 8000 bytes per row. REF: docs.microsoft.com/en-us/SharePoint/install/… Jun 28, 2018 at 7:32
  • Thanks for your replay, I mean 2097152 bytes. The problem is not in capacity of the row,it is in the request message size (i.e body size in rest API in case I using the rest api)
    – myomyo
    Jun 28, 2018 at 7:47
  • I'm facing the same issue. Apart from asking SharePoint admins to increase the limit from 2 MB to something more, it looks like there isn't anything we can do using C# or JavaScript. Did you find any other solution?
    – user841311
    Jan 8, 2019 at 16:18
  • @user841311 it's depend on your case, I have found a workaround with this by write all the data into a text file and upload the file into a SharePoint library, So I avoided send large requests. I know its a dummy way, but it is very useful in my case.
    – myomyo
    Jan 14, 2019 at 22:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.