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
Super User III
Super User III

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

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,831)