Skip to main content

Notifications

Power Automate - Using Connectors
Answered

Get worksheet by id using HTTP

(0) ShareShare
ReportReport
Posted on by 36

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!

  • Verified answer
    Papageno Profile Picture
    Papageno 36 on at
    Re: Get worksheet by id using HTTP

    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

  • Papageno Profile Picture
    Papageno 36 on at
    Re: Get worksheet by id using HTTP

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

  • Jcook Profile Picture
    Jcook 7,770 on at
    Re: Get worksheet by id using HTTP
    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard

Featured topics