How to send report end of the day

Hi All,

The bot runs every hour and saved report in the folder i want to send a final report at end of the day on how to do that in uipath.

Regard,
Hima

@thima

You can define by placing an IF condition

If business ending hour is everyday 6pm then

now.ToString(“HH”)<= “18”

Then place your Email activity

Hope this may help you

Thanks

This works but if bot did not run that time then?

@thima - This will get the recent file created in the folder…Say your bot runs at 4.30 or 5 or 6 pm or whatever time, it will check for the very recent report file

 Directory.GetFiles("YourFolderPath").OrderByDescending(Function(d) New FileInfo(d).LastWriteTime)(0)

Assign it to String Variable not String Array

Note: If there are lot of files in the folder and you want any specific ones, then feel free to add your search pattern something like below

 Directory.GetFiles("YourFolderPath","*Report*.xlsx")

Hope this helps…

You would have to write a separate automation to do that, and schedule it to run at the end of the day. Jobs run, complete, and stop - there’s no continuation of a Job later, it just has to be another Job that runs to do the end of day report.

1 Like