pnp / pnpjs

Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs
https://pnp.github.io/pnpjs/
Other
742 stars 302 forks source link

Is there any alternative to store large amount of data in Multiline Text column? #2980

Closed bhoomesh-spe closed 3 months ago

bhoomesh-spe commented 3 months ago

What version of PnPjs library you are using

3.x

Minor Version Number

3.15.0

Target environment

SharePoint Framework

Additional environment details

SharePoint Online, SPFx, React

Question/Request

Hello Everyone,

I need to store a large amount of data in the SharePoint list Multiline plain text column.

I have implemented the below call to update a SharePoint list item with a large amount of data.

import { spfi } from "@pnp/sp";
import "@pnp/sp/webs";
import "@pnp/sp/lists";
import "@pnp/sp/items";

const sp = spfi(...);

export const updateSPListItem = async (listName: string, item: any, itemId: number) => {
  delete item.id;
  const sp: SPFI = getSP();
  return sp.web.lists.getByTitle(listName).items.getById(itemId).update(item).then(res => {
    return res;
  }).catch((err) => {
    console.log("err..", err);
    return err;
  });
};

But it has thrown me the below error while updating the SharePoint list item.

{

    "odata.error": {

        "code": "-1, Microsoft.SharePoint.Client.InvalidClientQueryException",

        "message": {

            "lang": "en-US",

            "value": "The maximum number of bytes allowed to be read from the stream has been exceeded. After the last read operation, a total of 1049600 bytes has been read from the stream; however a maximum of 1048576 bytes is allowed."

        }

    }

}

Is there any alternative way to achieve the same?

Thanks

juliemturner commented 3 months ago

Break it up into small chunks in multiple columns maybe... I don't really have enough information to give you a better answer... To be frank, if you're hitting that type of limit then you've likely architected yourself off of the platform for whatever you're trying to do and you should consider building a database (Azure Table Storage, Azure SQL, etc) with an API front ending it...

patrick-rodgers commented 3 months ago

Closing this issue as answered. If you have additional questions or we did not answer your question, please open a new issue, ref this issue, and provide any additional details available. Thank you!

github-actions[bot] commented 3 months ago

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.