How to check wheather Email Attachment Download or Not

Hi I want to just check whether the Email Attachment is Saved or not in a specified folder. If yes then Proceed if Not then send an email/stop. Please suggest how can I check.
@Palaniyappan @lakshman @Lahiru.Fernando

2 Likes

Hi balkishan,

use the Path exists-Activity to check if a filepath exists: https://activities.uipath.com/lang-en/docs/path-exists
Use the Output boolean to proceed as needed.

Hope this helps!

Cheers,
Lukas

2 Likes

Hey Thanks for the quick response @lukasziebold , But It’s for path checking not for file bro but I want to check the attachment saved or not from the emails. If attachment saved then I can proceed if not then I just send the email/stop the process.

You’re welcome :slight_smile:

Of course it is bro!

The path can represent a file path or a directory path.

1 Like

Fine
Hope you will be saving the attachements with save attachment activity by mentioning a folder path
Mention the same path in the activity Path exists activity
And this activity works in a sense like it will go and watch for the file whether it exists in the file path or not
Which declares us whether the attachment is saved or not with the Boolean variable from the path exists

Simple isn’t it
Cheers @balkishan

1 Like

Do I need to give the path in a array variable or just give the folder name in the Path Exist Activity?

@lukasziebold

1 Like

We need to mention the path of that file in the path exists and it can either a string or passed through a variable
Cheers @balkishan

Any issue still @balkishan

1 Like

Yes bro @Palaniyappan
I given the pat of the files containing folder. But it gives me the False value see.
image

If I select the File it doesn’t check but when I select the Folder in the Path Exist Activity then only it works.

I want to check the file in the Directory.

Fine may i see the value of the path if possible with a screenshot
Cheers @balkishan

1 Like

@Palaniyappan

1 Like

I checked with and without back slash same result I am getting.

1 Like

Hi @balkishan - Try to check the file along with file extension, that will work.

Thanks,
AK

2 Likes

so I think I take the array type var in this case.

why “Files” is the default value given to the variable Path
This checks only the folder Files availability
Fine use a assign activity and before to this path exists and mention like this
out_Filepath = Directory.GetFiles(“yourfolderpath”,"*.yourfileextension").OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1)

this will give the file path of last saved file in that folder
now mention this variable out_Filepath in the path exists and check
kindly remove the default value of path and i would like to suggest one thing that dont name as path as it is a keyword, try to mention as path_exists

Cheers @balkishan

1 Like

Not showing the any files but files is there in the folder.

see bro files is there in the folder.

may i have a screen shot of that assign value
Cheers @balkishan

image

1 Like

what type of this variable String Array?

1 Like

use a write line before to this path exists and mention this in that
lets check whether any value is coming or not
and mention like this alone @balkishan
Directory.GetFiles(“yourfolderpath”,"*.pdf").OrderByDescending(Function(d) New FileInfo(d).CreationTime)(0).ToString
or even mention this and try once in the variable instead of the one mentioned in the previous comment @balkishan

–no we dont need it in a form of array and its a string variable actually

Cheers

2 Likes