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 / how to open first file...
Power Automate
Unanswered

how to open first file in a list

(1) ShareShare
ReportReport
Posted on by 26

i wat to open a file who's name changes on every download.

it's the first file in my download folder. i tried something like get files in folder, then referencing with %files[0]% or %files%[0] but get parsing errors.

mjlangone_0-1719864376475.png

i've tried 

C:\Users\mjlangone\Downloads\%Files[0].Name%
%Files[0]%
%Files[0].FullName%

 

mjlangone_1-1719864604655.png

mjlangone_40-1719864693731.pngmjlangone_41-1719864725294.png

 

mjlangone_42-1719864763164.png

 

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    So, get files in folder is working, cuz it's getting past that step.

     

    Sort by Last Modified-Descending and then pulling %Files[0]% is correct, so I think you are good there.

     

    Have you tried different settings on Encoding?  There is a system default setting.

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @mjlangone ,

     

    Please find the solution.

    VishnuReddy1997_0-1719896605222.png

     

    Code:

    Please copy the below code to your flow and just change the path.

     

    Folder.GetFiles Folder: $'''C:\\Users\\Downloads''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.LastModified SortDescending1: True SortBy2: Folder.SortBy.LastModified SortDescending2: True SortBy3: Folder.SortBy.LastModified SortDescending3: True Files=> Files
    File.ReadFromCSVFile.ReadCSV CSVFile: Files[0].FullName Encoding: File.CSVEncoding.UTF8 TrimFields: True FirstLineContainsColumnNames: False ColumnsSeparator: File.CSVColumnsSeparator.SystemDefault CSVTable=> CSVTable

     

     If you face the problem in Read text from csv file just change the encoding methods as shown in below image.

    VishnuReddy1997_1-1719896798548.png

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 229 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 223 Super User 2026 Season 2

#3
Valantis Profile Picture

Valantis 136 Super User 2026 Season 2

Last 30 days Overall leaderboard