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 / Get File Name from a d...
Power Automate
Suggested Answer

Get File Name from a directory on a windows server

(0) ShareShare
ReportReport
Posted on by 43
I need to create a list of file names from a directory on a windows server. I'm trying to do this through Power Automate Desktop. AI instructions tells me to use Get File Name. I don't find that function in the Desktop. Can someone advise me as to how to get the file names.
 
Thanks
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    Hi,
     
    Try like this
     
    Here it will get list of files from a folder which contains list of file object- each file object has details of file - including its file name, so to specifically store the file name- create a seperate list and append the file name to that.
     
    You can paste the below code to get sample flow
    SET FileNames TO []
    Folder.GetFiles Folder: $'''D:\\Temp\\CustomActions''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files2
    LOOP FOREACH File IN Files2
        SET FileNames TO FileNames + File.Name
    END
    
     
     
    Hope it helps!
     
    Mark it as solution if it resolves your query !
     
  • ME-14102049-0 Profile Picture
    43 on at
    I'm not getting just the file name, I'm getting the path and the file name. He is my process with the results.
  • ME-14102049-0 Profile Picture
    43 on at
    I believe I see what I dd wrong. I've marked your answer as the solution. Thanks,  for your help.
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    Hi
     
    if the issue is resolved, kindly mark the answer as solution.
     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard