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
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
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
Of course it is bro!
The path can represent a file path or a directory path.
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
Do I need to give the path in a array variable or just give the folder name in the Path Exist Activity?
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
Yes bro @Palaniyappan
I given the pat of the files containing folder. But it gives me the False value see.
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
I checked with and without back slash same result I am getting.
Hi @balkishan - Try to check the file along with file extension, that will work.
Thanks,
AK
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
may i have a screen shot of that assign value
Cheers @balkishan
what type of this variable String Array?
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