web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Ge SharePoint File Ide...
Power Automate
Answered

Ge SharePoint File Identifier by Name

(0) ShareShare
ReportReport
Posted on by 1,401 Moderator

I am trying to get the Identifier of a file in SharePoint by its filename so I can delete it. The file came from a Form and I get the filename with:

 

 

first(body('Parse_Dust_Blown_Out_Photo_JSON'))['name']

 

 

When I use "Get files (properties only)" with a Filter Query of:

 

 

FilenameWithExtension eq '@{first(body('Parse_Dust_Blown_Out_Photo_JSON'))['name']}'

 

 

It says the file is not found.

 

When I don't use a Filter Query and I output the "Get files (properties only)", it shows the file is there:

 

 

[
 {
 "ID": 562,
 "{Name}": "bruce-banner_Adam Haas",
 "{FilenameWithExtension}": "bruce-banner_Adam Haas.jpg",
 "{Path}": "Shared Documents/Apps/Microsoft Forms/Daily Mulch Checklist/Photo of Dust Blown Out/",
 "{FullPath}": "Shared Documents/Apps/Microsoft Forms/Daily Mulch Checklist/Photo of Dust Blown Out/bruce-banner_Adam Haas.jpg",
 "{IsCheckedOut}": false,
 }
]

 

 

IPC_ahaas_0-1663943124858.png

 

So what am I doing wrong?

Categories:
I have the same question (1)
  • Verified answer
    Pstork1 Profile Picture
    69,127 Most Valuable Professional on at

    The file identifier is the relative path to the file, but it needs to be encoded so that all the special characters are changed to their HTML equivalents.

    So if the file name is test.txt and its stored in Folder 1 of the Shared Documents library in SharePoint then the relative path is

    /Shared Documents/folder 1/test.txt

    Putting that inside a encodeUriComponent() provides the following output which is the file identifier.

    %2FShared%20Documents%2Ffolder%201%2Ftest.txt
  • IPC_ahaas Profile Picture
    1,401 Moderator on at

    Thank you! That is so much simpler as I don't need to get the file details since I already have them. This worked great.

  • Baytars Profile Picture
    10 on at

    That action never says we have to encode the path.☹️

  • Pstork1 Profile Picture
    69,127 Most Valuable Professional on at

    If you use the regular dynamic content you don't have to encode the path.  But if you build the path from scratch as a string you do need to encode it or you'll get an error because it doesn't know how to handle the special characters.  The docs rarely discuss how to enter raw content into these fields.

  • Baytars Profile Picture
    10 on at

    @Pstork1 wrote:

    If you use the regular dynamic content you don't have to encode the path.  But if you build the path from scratch as a string you do need to encode it or you'll get an error because it doesn't know how to handle the special characters.


    I first used dynamic content to check if I input in the correct format. The path looks unencoded. Before I saw this post, I never know what was wrong. Thank you!

     


    @Pstork1 wrote:

    The docs rarely discuss how to enter raw content into these fields.


    Thanks to my experience as a web developer, I know `encodeURIComponent` does this job.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard