How to delete the existing file in the folder even before downloading another with same name

Hi,

I am downloading a file from outlook mail and renaming the sheets and executing it. But some times bot fails due to various reasons and if we want to run again with the same file then the bot is failing due to the sheets are already renamed. So how can we delete the previous file.

Regards,

@raju_alakuntla

Hi,

Use exist activity to check the particular file exist in the folder.Use delete file activity to delete the file in the folder.

Thank you

hi @raju_alakuntla
follow this steps:
1-file exist activity
2-if exist
3-delete file

Hi @raju_alakuntla

If you are saving the file from outlook using save attachments activity then check true on the replace existing. So it will replace the file if already exists without further process.
else
you can delete the file by using file exists activity. If exists delete the file using delete file activity.

Hope it helps.

1 Like

Hi @raju_alakuntla

Use file exists activity and for that the output will be a boolean and place the boolean value in if condition for example boolean = true and then in then condition place the delete file activity so that if the file exists then only the file gets deleted or else the process gets continued.

Regards

thanks a lot @supriya117

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.