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 / Trigger if file exists...
Power Automate
Answered

Trigger if file exists with with variable (changing) file name

(0) ShareShare
ReportReport
Posted on by 214

Hey guys, 

 

I'm really stumped on how to start with this, so I am open to suggestions.

 

One of my end user teams, has a folder where they dump .txt files into. 

 

The .txt files have a naming scheme [Todays Date]_Expenses.txt

 

I have been asked to create a flow that will look for [Todays Date]_expenses.txt ; Then convert that into a CSV, and then place that somewhere else on the network. Then there will be a timer to run this everyday at 4PM EST.

 

There is the "IF File Exists Condition" 

 

Is there a way I can add functional variable into the file pathing scheme 

 

or possibly create my own variable in [MM_DD_YYYY] format, and then insert it into the pathing scheme?

 

if file exists power automate desktop.JPG

I have the same question (0)
  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Nope. You will have to use Get file(s) in folder (which can have a name filter) and then use the content of that list.

  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    Get Current DateTime to %CurrentDateTime%

    Convert date to text custom format MM_dd_yyyy to %FormattedDate% 'ensure the M's are capital...mm stands for minutes.

    If File Exists %FormattedDate%_Expenses.txt

        Change Extension .csv

    EndIf

     

    Good luck.  If change extension doesn't work, you may have to open it in Excel and Save it as a .csv.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard