Checking files in folders

Hello amazing people,

I have a process that goes though an email inbox. Depending on the Email subject it will save the attached files using a “Save attachment” activity. The next part of the workflow needs to go though every attachment and open it. the issue is. The Attachments are not saved in time and so my code breaks. Any help will be great :slight_smile: (I don’t want to use a “delay” activity, as this will waste time)



ALL the attachments in Mail—> VarMailMessage(0).Attachments
Form this you can get the name of the attachments: VarMailMessage(0).Attachments(1).Name

Once you have the name, you can use PathExist after save attachment to check whether attachment is present in the folder or not.

HI @sachinbhardwaj.

Thanks. However, I realised that I was stupid and checked the folder before it saved any attachments. So this fix wasn’t necessary. I did the check with this code " Directory.getFiles(Email_Attachment_Folder_Path,“*.xlsx”)" This will check the folder and return a list of all file paths that are excel files.

Thanks Anyway

1 Like

Yes, your solution is only way, I gave it that because i thought you were saving one by one somehow… Anyways Great :smiley:

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