Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Get file identifier for list rows present in a table when using a dynamic location

(0) ShareShare
ReportReport
Posted on by 19

I have a flow that uses "List rows present in a table". I am getting the location dynamically but I cannot find out how to get the file. From the posts I have been reading and researching, I know I need the file identifier but cannot figure out how to find it. The file will always be named the same, such as myfile.xlsx, and the table will always be Table1. Any ideas?

 

Thanks,

  • VEEROCHET Profile Picture
    18 on at
    Re: Get file identifier for list rows present in a table when using a dynamic location

    could spell out what is after root:/ in your uri?

    Thanks

  • Verified answer
    Tim_S Profile Picture
    19 on at
    Re: Get file identifier for list rows present in a table when using a dynamic location

    After some more research, here is what I ended up doing. I used two actions.

    Tim_S_0-1621391225953.png

    I created a variable for Site Address since I ended up using it a few more time through the entire flow. I get the first part of the path for the Uri from the user and finish it statically as the sub-folders and file name will be the same every time.

    Tim_S_1-1621391596802.jpeg

    Location is your site address.

    Document Library: outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['parentReference']?['driveId']

    File: body('Send_an_HTTP_request_to_SharePoint')?['id']

    Table will always be Table1 and it allowed me to type Table1 as a custom value.

    Tim_S_2-1621391902080.png

     

     

  • WillPage Profile Picture
    2,058 on at
    Re: Get file identifier for list rows present in a table when using a dynamic location

    If you don't already know the ID of the file, find it with Get files (properties only) and specify FileLeafRef eq 'myfile.xlsx' in the Filter query.

  • Tim_S Profile Picture
    19 on at
    Re: Get file identifier for list rows present in a table when using a dynamic location

    @WillPage I do not have a Get file properties action. I have a Get file (properties only) action. Did you mean that or do I need to add a Get file properties action?

  • WillPage Profile Picture
    2,058 on at
    Re: Get file identifier for list rows present in a table when using a dynamic location

    @Tim_S  You are correct, I have given you the wrong info. Here's the real way of doing it:

     

    From the Get file properties action, add a compose and put this expression in:

    WillPage_0-1620772477894.png

     

    Now rejoin this array on /

    WillPage_1-1620772498792.png

     

    Now do this, where the site address is your dynamic URL

    WillPage_2-1620772564287.png

     

    Now this:

    WillPage_4-1620772723657.png

    Then this:

    WillPage_5-1620772743063.png

    And this. Location is your dynamic URL, Document library is the output of the Drive ID above and File is the output of File ID

    WillPage_10-1620773089191.png

     

    Filter its output for Name = Table1

    WillPage_7-1620772858512.png

     

    Now select its ID

    WillPage_8-1620773013341.png

     

    ..and finally use it in the List rows action

    WillPage_9-1620773054340.png

     

     

     

     

     

     

  • Tim_S Profile Picture
    19 on at
    Re: Get file identifier for list rows present in a table when using a dynamic location

    @WillPageEverything looks good up to the List rows present in a table action. I get an Invalid Request
    clientRequestId: with a string Id here
    serviceRequestId: with a string Id here.

    If it helps, the document library is associated with a channel in Teams.

  • WillPage Profile Picture
    2,058 on at
    Re: Get file identifier for list rows present in a table when using a dynamic location

    The file identifier in the context of the Excel online API is a long string. You can parse it out from the Get file metadata action.

     

    What you need to do here is pass in the site URL from the Power App as the dynamic content (e.g. https://mycompany.sharepoint.com/sites/dynamic%20site) and use it in the get files (Properties only) action. In the Advanced settings of that Get files action, put this into the Filter query: FileLeafRef eq 'myfile.xlsx'

     

    This will return a collection of files within that site/library combo called myfile.xlsx. If there is only one it'll still be a collection (array) but with only one item.

     

    Now you need to get the file ID of that file for the List rows action.

     

    Add a Get file metadata action. Put the same dynamic site address in there as the previous action and for the Identifier, add an expression: first(body('Get_files_(properties_only)')?['value'])?['{Identifier}']

     

    Now, add a compose and put this expression in: last(split(outputs('Get_file_metadata')?['body/FileLocator'],'id='))

     

    Now the output of the compose can go into the List tables action as dynamic content.

     

    A further note, you probably won't get away with typing Documents as a custom value into these actions for the library name. Use the Get all lists and libraries action and filter the output for Documents or Shared Documents

    WillPage_0-1620692629687.png

     

     

  • Tim_S Profile Picture
    19 on at
    Re: Get file identifier for list rows present in a table when using a dynamic location

    List rows present in a table.PNG

     

    Location - will be a custom value retrieved dynamically from PowerApps. Not sure if the way I am using it is correct.
    Documents - will be a custom value entered as "Documents."

    File - I need help with but the file will always have the same name, such as "myfile.xlsx."

    Table - Will always be named "Table1."

     

    The error details are "The parameter 'file' has an invalid value". The value is the path to the file. From what I have read on it, it needs a file identifier and not a path.

     

    Hope this helps. Let me know if you need information.

    Thanks

  • Muralidharan Profile Picture
    340 on at
    Re: Get file identifier for list rows present in a table when using a dynamic location

    Hi @Tim_S ,

    Can you please share the flow to get more visibility ?

     

    Thanks,

    Murali

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1