Another form of filter that I would like to try is from the creation of the array. For example, in the image the file names have to contain the word “Received” but not the word tmp. In this thing, how do I add more words apart from “Inbox”, I would also like to add “KREDI” or other words, like in the first image.
One file is Received_GEN_ KREDI EN 15.03.xlsx
Finally, here inside can i use regex??
“Directory.GetFiles(folderDownload,“Received”).Where(Function(w) Not (Path.GetFileNameWithoutExtension(w).ToLower.Contains(“tmp”))).ToArray()”
@Lynx When an exception comes at Assign activity (highlighted one) the bot was handling that exception by switching to the catch block (You can also test by keeping some message box in the catch block to check whether bot entering into that block or not).
Later that it was trying to execute the if where you are getting different exception since the variable value was empty
Do you want to continue the process still the bot encounters this exception or do you want to continue with the next file ?
@Lynx Yes, it was showing that exception since that variable was empty. If you want to handle this then you can add another condition in the If activity like below
String.IsNullorEmpty(FilesEsUrEc)
or If you want to continue with the next file then the complete code with in the for each has to be put in a Try Catch. This way the bot switches to the catch block if any exception comes and it loops back to the next file. Please find below sample workflow for better understanding