Hello wonderfull people,
Please i need a help regarding this problem:
i have a case where i need to filter some emails having excel attachments and save them. But just the attachement whose names are (“MMM” or “SSS”).
I am using a If activity (inside an for each activity) and the conditions (mail.Attachments.Any(Function(x) x.Name.ToLower.Contains(“MMM”)) or mail.Attachments.Any(Function(x) x.Name.ToLower.Contains(“SSS”)))
However,
the problem is:
if the email has more than one attachment, and one of them respects the string (but not the others ones) , then my robot save not only the attachment that respect the names criterias but also those who are not respecting the name criteria. I need to save just the attachments having “MMM” OR “SSS” as names…
Since you are converting the Name to ToLower, it’s not recommended to check for the Contains with Caps character. Please try the following query & let us know:
mail.Attachments.Any(Function(x) x.Name.ToLower.Contains("mmm") Or x.Name.ToLower.Contains("sss"))
Hello @Anil_G and thanks for helping.
yes , i am using a save attachment activity
After checking if my email has attachment (excel type) i am using a code (shown in the picture below - notepad ).
Hello @Anil_G
One short question:
The filter here is case sensitive? if yes, is there any way to convert it ToLower …(i mean a syntaxis to make it work not only with capital letters but lower case letters)
i meant instead of using:
“.(mmm|Mmm|MMm|MMM|mMm|mmM).”
that is too long and if the string has more than 3 letters it will make longuer too.
Thanks