Unable to search latest .csv file and attach in Outlook for send

Unable to search latest .csv file and attach in Outlook for send.

I need to search specific .csv file (name starts with-- abc_123.csv, abc234.csv so common string would be abc.csv ) from specific folder --C:\Users\abc\Downloads*

Please help me to get the exact activities with workflows . Later i will use this grepped latest .csv to attach or rename to specif one and attach in mail for sent.

Hi @AkshaySi

Use string array as strarr=Directory.getFiles(inputffilepath,“abc”,".csv)
Based on that you can attach in outlook

Which activity type i need to use this …Like do i need to define any Variable /Assign anything to store this ?

Hi @AkshaySi
Use Assign activity based on strarray on lhs= Directory.getFiles(inputffilepath,“abc”,".csv) on rhs

Ashwin S

Array.ForEach(Directory.GetFiles(path),Sub(x) File.Delete(x))
In above what all parameter i need to put to make it to delete only .csv files only

1 Like

hope these steps would help you resolve this
–use a assign activity and mention like this
arr_filepath = Directory.GetFiles(“yourfilepath”,“*.csv”)
where arr_filepath is a variable of type string array
–now use a for each activity and pass the above variable as input and change the type argument as string in the property panel of for each activity
–inside the loop use DELETE activity where in the input pass as item so now all the csv files in that folder will get deleted one by one

kindly try this and let know for any queries or clarification
Cheers @AkshaySi

Dude, not worked …
attaching ,my old code, just wanted to detect new latest file name (actually downloading the file from web , in that case each time it is having different name but same .csv format) and rename it. later i will use same file to attach in outlook mail action.

Delete All files INside a directory.xaml (4.9 KB)