In my Flow, I use the "Invoke an HTTP request" action to connect to an Excel file in a document library in SharePoint Online. I've used John Lius excellent tutorial on using Microsoft Graph to read an Excel file and it works fantastic.
However, the explanation given uses the sheet name and I need to use the id instead. The Excel file I'm trying to read is an exported SharePoint list and unfortunately the query name is used to name the sheet like this:
So everytime the list is exported, a new query is used and a new name appears in the sheet. So when the flow runs, I don't know the sheet name. But I do know that it is the first (and only) sheet. According to Microsoft Docs you can use an id instead of the name to get the sheet, but I don't understand the syntax.
This is my action using the sheet name:
Can anyone please tell me the syntax to get the first worksheet in the Excel file without using the name.
I've tried the following variants:
...workbook/worksheets(0)
...workbook/worksheets[0]
...workbook/worksheets{0}
...workbook/worksheets/0
...workbook/worksheets/(0)
...workbook/worksheets/[0]
...workbook/worksheets/{0}
But this only gives me 404 "The requested resource doesn't exist." or 400 "Empty segment encountered in request URL."
This is driving my crazy, please help!
Hi, guys!
I finally got this working and thought that I would share my findings.
To get a worksheet by name, you can use this:
...workbook/worksheets/nameOfTheWorkSheet... (see my first post).
To get the first worksheet regardless of name, you can use this:
...workbook/worksheets/%7B00000000-0001-0000-0000-000000000000%7D...
Here's my action:
Not really what I was looking for, but thanks for your comment. I wasn't aware of his blog, lots of goodies there.