An API that connects multiple Microsoft services, enabling data access and automation across platforms
Graph API DataBodyRange/delete returns ItemNotFound on .xlsx but works on .xlsm
Hi,
I have a Power Automate Flow that uses Invoke an HTTP Request steps to interact with an Excel file via the Microsoft Graph API.
The Flow was originally built against an .xlsm file and worked perfectly. I am now trying to point it to a new .xlsx file in the same SharePoint location.
The issue is with HTTP Request 1, clearing the table before re-populating it.
The URL being used:
https://graph.microsoft.com/v1.0/sites/{site-id}/drive/root:/Location%20Guides/UHS%20New.xlsx:/workbook/tables/HiddenDB/DataBodyRange/delete
Error returned:
{
"error": {
"code": "ItemNotFound",
"message": "The requested resource doesn't exist."
}
}
The file exists at the correct path (GET on the file returns 200). The table HiddenDB exists in the file (GET on /workbook/tables returns 200). The same URL structure worked on the .xlsm version of the file. HTTP Requests 2 and 3 (rows/add) work fine against the .xlsx file. My questions is DataBodyRange/delete supported for .xlsx files via Graph API If not, what is the recommended way to clear all rows from an Excel table in a .xlsx file via Graph API without looping through rows one by one? And is saving the file as .xlsm the only workaround?
Any guidance appreciated. Thank you.