cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smacsween
Regular Visitor

Renaming file where source file name varies

I am trying to build a flow to rename a source file, xlsx format.

But the filename of the source file varies each time it is created by a third party.

 

It is the only xlsx file in that OneDrive folder.

PA seems to require me to choose a particular file but the filename differs each day.

 

What do I need to add to my flow to pick up that xlsx file, irrespective of whatever it is called on that day, and rename it to the non-changing filename?  

 

Thanks!

3 REPLIES 3
ChristianAbata
Super User
Super User

hi @smacsween  what you can do is use expressions.

 

Imagine that you have this name in a propertie call FileName: myfilexample.xlsx

 

so you can add a compose action and inside an expression to get the filename of the file extension

Filename:

first(split('FILENAMEPROPERTIE','.'))

Fileextension:

last(split('FILENAMEPROPERTIE','.'))

 

If you want to see who you can add expression you can see my video here https://www.youtube.com/watch?v=MHvWuFMXhes

 

I hope this can helps

 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Thanks Christian.  Your solution is good but it only works where I know the filename already.

 

I want the flow to search for the xlsx file - note it will be the only one of that filetype in the folder, then depending on that filename, change the filename to a new, standard filename.

 

For example the filenames may be 

1024535.xlsx

57232234.xlsx

and each time I run the flow, i want it to select the relevant filename and change it to "profiles.xlsx"

 

Any ideas? 🙂

@smacsween  ohh to find files you can use this actions to one drive or sharepoint

 

list.PNG



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,843)