Microsoft Graph: OpenWorkbookTooLarge – any way around this? - microsoft-graph-api

When calling the createSession or workbook/worksheets endpoint I'm getting the following error:
{
"error": {
"code": "OpenWorkbookTooLarge",
"message": "Service Unavailable.",
"innerError": {
"request-id": "c997d356-c343-44bb-b49b-fc03d7482f75",
"date": "2018-11-28T22:58:21"
}
}
}
The spreadsheet in OneDrive has only one sheet with 16 columns and about 160,000 rows. Is that too large to work with? That would be very disappointing...

Excel Online have file size limit, based on the docs and the error you get, you have trigger the limitation, maybe not file size but other one.
Workbooks that exceed 10 megabytes (MB) cannot be viewed in Excel
Online from within Microsoft SharePoint Online.
For none-dev user, they can use the PowerBI/Local Excel/PivotTable as workaround.
For devolper, there are no workaround now.

Jeez, it's even worse: 5MB
That's sad, really.

Related

How to get a list of just files in a particular folder on OneDrive using Microsoft Graph API

Can anybody tell me how to get a list of just files in a particular folder on OneDrive using Microsoft Graph API? I believe I found an approach I have to use but either I don't understand something or it is impossible. I can get a list of children items in a folder. I can use $filter=folder ne null to get just a list of folders but I don't understand how to get a list of files. If I negate the expression, make it $filter=folder eq null it gives me an error. I tried many other possible expressions like $filter=file ne null, $filter=size ne 0 even though it is not exactly a filter for files a files can be 0 size but anyway it gives an error as well.
Update:
Tested in a test tool. It gives
{
"error": {
"code": "invalidRequest",
"message": "Invalid request",
"innerError": {
"date": "2021-02-23T06:25:08",
"request-id": "4d1903d3-d989-4d90-8130-479ac1b24af2",
"client-request-id": "4d1903d3-d989-4d90-8130-479ac1b24af2"
}
}
for this query
https://graph.microsoft.com/v1.0/me/drive/root/children$filter=folder eq null
Here is the link to the tool
https://developer.microsoft.com/en-us/graph/graph-explorer

Can't get the list of worksheets in a workbook stored in sharepoint using microsoft-graph-api [duplicate]

This question already has answers here:
Error when adding rows to a sharepoint excel workbook table MaxRequestDurationExceeded
(2 answers)
Closed 2 years ago.
I'm not able to get the list of worksheets in a workbook for some reason. this might be related to my other issue which is can't add records in a excel table
this is the full error message that is returned to me when calling this endpoint: https://graph.microsoft.com/v1.0/sites/OurSiteId/drives/OurDriveId/Items/OurFileId/workbook/worksheets
{
"error": {
"code": "MaxRequestDurationExceeded",
"message": "We're sorry. We couldn't finish what you asked us to do because it was taking too long.",
"innerError": {
"code": "gatewayTimeoutUncategorized",
"message": "The service wasn't able to complete the request within the time limit.",
"innerError": {
"code": "MaxRequestDurationExceeded",
"message": "We're sorry. We couldn't finish what you asked us to do because it was taking too long."
},
"date": "2020-11-24T12:55:28",
"request-id": "c28bc40e-4ba6-4606-8c5a-ea0663cafa29",
"client-request-id": "c28bc40e-4ba6-4606-8c5a-ea0663cafa29"
}
}
}
there appears to be a file size limit of a workbook as described here file limit in sharepoint but still, the file that I am working is only 40mb (limit is 50mb) and I am already encountering access issues on the file.
The file that I am working already has more than a million records, is that possibly the cause of the issue?
It may be the case, but just make sure you can open the excel file in your browser/onedrive and you can write the info manually. As a rule of thumb make sure that it doesn't contain any styles, any empty cells/columns, any macro's etc

Microsoftgraph Which Ids to remove license?

I would like to remove a license from a user using the microsoft graph API. I am currently using graph explorer to experiment with this.
I have not found much information here regarding microsoftgraph. I find the microsoft documentation and examples unclear on this point.
Here is the data I have to work with. graph explorer snip_one I have tried option A)
When I post to the assignLicense endpoint, I get this error message, and I find little information via google/SO about this. graph explorer snip_two Specifically, I find little about
"Cannot convert a primitive value to the expected type 'Edm.Guid'"
{
"error": {
"code": "Request_BadRequest",
"message": "Cannot convert a primitive value to the expected type 'Edm.Guid'. See the inner exception for more details.",
"innerError": {
"request-id": "7e63fcf2-8fce-4a5c-9f40-3348fba1fb13",
"date": "2019-12-05T01:37:14"
}
} }
OK, with more experimentation, the skuID was what was needed in the removedLicenses list
It's the GUID here: https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/licensing-service-plan-reference
Note there's a link to the latest version in CSV file format.

UnknownError accessing pages from OneNote

I am connecting to Notebooks stored on SharePoint and getting "UnknownError" using the Graph API when trying to retrieve Pages.
I have no problem querying notebooks, sections or sectiongroups - that's all working, so no authentication problems or anything
Request:
https://graph.microsoft.com/v1.0/sites/{app id}/onenote/pages
Error below:
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "65721acc-f0d9-40d6-bf80-aac1507a6c2f",
"date": "2018-01-02T17:34:21"
}
}
}
Graph explorer returns this after about 30 seconds, so I'm guessing it's timing out. There are about 10 notebooks in the site I'm connecting to, which each have several hundred pages
I do only need to return 1 page at a time in almost every case. I have tried adding a $filter= at the end, but get the same problem
I would strongly recommend to get pages for each section rather than getting all the pages that the user has access to.
Please refer to the bottom 2 recommendations in this article: https://blogs.msdn.microsoft.com/onenotedev/2017/07/21/a-few-performance-tips-for-using-the-onenote-api/

Filter files by date range in OneDrive

I would like to obtain the OneDrive content using Microsoft Graph filtered by date so that only files created between particular dates are obtained.
I have tried:
/v1.0/me/drive/items/{id}/children?filter=createdDateTime ge 2016-02-26T14:41:09Z
but get following response
"error": {
"code": "invalidRequest",
"message": "The request is malformed or incorrect.",
"innerError": {
"request-id": "c636022f-2fa9-4e41-b8fc-63be5fc5e681",
"date": "2017-04-07T10:05:46"
}
}
I have also tried:
/v1.0/me/drive/root/children?filter=name eq 'folderapr05'
and it works.
Does OneDrive support filter parameter for dates?
Filtering by dateTime isn't supported.
If you're attempting to do this for the purposes of syncing with OneDrive, you may want to take a look at delta. This method allows your app to track changes to a drive and its children over time.

Resources