Retrieve a file name and store as a variable

Part of my workflow outputs an excel spreadsheet to a location on my pc.
The name of the file changes each time (the directory location and part of the filename is always the same)
I want to retrieve the complete file path, name and extension and store that as a singe variable to use in a later part of the process…

Should be easy but not getting very far… Any recommendations?

How are you specifying the output file path? Is this a downloaded file?

Hi @DougGowans,

You can use Directory.GetFiles(“Folder path”)

get recent file.xaml (8.0 KB)

Yes a downloaded file.

Thanks Anil. I’m struggling with the syntax. There are a load of different files in the directory and I want to retrieve the one with a specific name like…

Directory.GetFiles(“C:\Users\bob\Downloads”, +“test*.txt”)


You should be specifying folder name in the syntax not the file name, if you are manually doing how will you differentiate between the correct file and the other files.

Thanks. Worked it out in the end. Ta

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.