Hello All,
Hope someone can help.
I am trying to delete a worksheet from an excel file on sharepoint and getting and error with the URI.
Error
{"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The expression \"web/lists/GetByTitle('SC Customer Shipping Schedules')/items/%2fSC+Customer+Shipping+Schedules%NameofCustomer_Shipping+Schedule_22_52_2022+8_52+AM.xlsx/workbook/worksheets/Sheet1\" is not valid."}}}
Thank you
Solved! Go to Solution.
Hi @egornua1,
Is this a one time thing? In my earlier shared example I used the Graph Explorer to figure out those specific ids for my sample site, document library and Excel document.
https://developer.microsoft.com/en-us/graph/graph-explorer
Search for your site and return id and weburl
https://graph.microsoft.com/v1.0/sites?$search=PowerUsers&$select=id,webUrl
List drives and return name and id (this uri uses the siteid returned in the first list sites query)
https://graph.microsoft.com/v1.0/sites/@{variables('SiteId')}/drives?$select=name,id
List children of Drive and return name and id (this uri uses the siteid returned in the first list sites query and the driveid returned in the second query)
https://graph.microsoft.com/v1.0/sites/@{variables('SiteId')}/drives/@{variables('DriveId')}/root/children?$select=name,id
You can also use those URIs in three different Send an HTTP request actions (Office 365 Groups connector) if you need to dynamically retrieve those ids. But in that case you probably need to apply some filtering logic as well in your setup.
Hi @egornua1,
That is a Graph API method, not a REST API v1 method.
https://learn.microsoft.com/en-us/graph/api/worksheet-delete?view=graph-rest-1.0&tabs=http
I would suggest to try it in a Send an HTTP request action (of the Office 365 Groups connector).
Try something like below.
https://graph.microsoft.com/v1.0/sites/@{variables('SiteId')}/drives/@{variables('DriveId')}/items/@{variables('DriveItemId')}/workbook/worksheets/@{variables('SheetName')}
@Expiscornovus - thank you for the direction on this as is new to me.
Could you tell me how to get the variables - siteid | DriveId | DriveItemId?
file resides in sharepoint doc library.
Thank you.
Hi @egornua1,
Is this a one time thing? In my earlier shared example I used the Graph Explorer to figure out those specific ids for my sample site, document library and Excel document.
https://developer.microsoft.com/en-us/graph/graph-explorer
Search for your site and return id and weburl
https://graph.microsoft.com/v1.0/sites?$search=PowerUsers&$select=id,webUrl
List drives and return name and id (this uri uses the siteid returned in the first list sites query)
https://graph.microsoft.com/v1.0/sites/@{variables('SiteId')}/drives?$select=name,id
List children of Drive and return name and id (this uri uses the siteid returned in the first list sites query and the driveid returned in the second query)
https://graph.microsoft.com/v1.0/sites/@{variables('SiteId')}/drives/@{variables('DriveId')}/root/children?$select=name,id
You can also use those URIs in three different Send an HTTP request actions (Office 365 Groups connector) if you need to dynamically retrieve those ids. But in that case you probably need to apply some filtering logic as well in your setup.
@Expiscornovus - Thank you for the help on this.
I managed to get it working for my requirement.
One thing, i was using the version 2 HTTP action and that didn't work so reverted to the previous version and its working fine. Thanks Again.
User | Count |
---|---|
88 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
127 | |
54 | |
38 | |
24 | |
21 |