cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Papageno
Frequent Visitor

Get worksheet by id using HTTP

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:

 

 a.png

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:

b.png

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Papageno
Frequent Visitor

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:

Untitled.png

View solution in original post

3 REPLIES 3
Jcook
MVP

Hi,

If you follow Johns tutorial on his blog post. He explains it better there.

http://johnliu.net/blog/2019/5/workarounds-needed-to-use-the-excel-connector-in-microsoft-flow

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Papageno
Frequent Visitor

Not really what I was looking for, but thanks for your comment. I wasn't aware of his blog, lots of goodies there.

Papageno
Frequent Visitor

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:

Untitled.png

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (4,511)