Get today dated xlsx file from a directory

hi all, i have a folder containing past 2 days saved excel files. i need your support in fetching only today’s files from the folder. please refer below image and suggest me please.

@Manoj_sreekanth

Please try this…

Directory.getfiles(“folder”,“*” + Now.Tostring(yyyy-MM - dd) + “.xlsx”)

This gives ypu a list of matching file locations

Or

use for each file in folder activity with filter on date same as above

Both would work

Cheers

it is printing system.string as output multiple times

@Manoj_sreekanth

This would give you list…

If you want the files then use arr(0) ,arr(1) etc for each matched file

Arr ia the list of files generated by directory.getfiles

Cheers

hi @Anil_G okay , but i am saving each file in an array right?

@Manoj_sreekanth

This will give you array of files…you are saving each file location as strings in the array

So if you need the location the use arr(0) for the first location

Cheers

can u please provide me the expression for what you’re saying

@Manoj_sreekanth

Directory.getfiles("folder","*" + Now.Tostring("yyyy-MM - dd") + ".xlsx")(0)

This will give you first matched file

So now if you need all then first create variable of array of strings say arr then use assign

Arr = Directory.getfiles("folder","*" + Now.Tostring("yyyy-MM - dd") + ".xlsx")

Now to access each file arr(0) ,arr(1) etc can be used

Or can use a for loop …give arr as input , change the type argument to string and inside use log message with currentitem

Hope this helps

Cheers

Hi @Manoj_sreekanth

Kindly try the attached workflow as this will move the todays file in another folder.

Regards
FetchTodaysFile.xaml (8.1 KB)

seems like document is invalid. could u please share the screenshot?

Hi @manoj

Kindly refer to the image.