How to send multiple dynamic file path as email attachments

hi friends:
how to choose correct file’s name in each folder as attachments to send email??
there are three folders contain different files which has the same name like"XXX_IT_Department"
when folder1 has “XXX_IT_Department”, but folder2 also has t “YYY_IT_Department”, but folder3 has not “WWW_IT_Deaprtment”. so it cannot send email attachments. the error: it cannot find file??

thanks!!

@ANNE

Give full file path with extension as a input to send email action.

1 Like

hi rahatadi

thanks, I use a scalable file path, but each file title in three folders may not be consistent.
for example,
I have a document title is IT, but there is no IT in one of the folder.

hello @ANNE
try like below…
Directory.GetFiles(“C:\Temp”,"* keyword*")(0).ToString
in here keyword is common word which is constant in all file names. Like in your case it is “IT_Department”

@ANNE
You can use like @akshaysandhu suggested method…
If you want i can build code for you if you can provide some sample folder structure.:blush:

hi rahatadi

:微笑:thank you for your kind help!!
here are the example:
Example.zip (16.2 KB)