I need to filter outlooks email according to two criterias:
if subject has a string type “AAA”, “BBB”, “CCC” etc.
2.- if the email attachments has a string name : “AAA”, “BBB”,“CCC”, etc.
My problem is : should it be better to use (if, if-else, or Switch) to filter ? considering that each email have to be verified in two places (the subject area or the name attachement in just one passage of the algorithme)
Here i show you what i developped until now, any suggestion would be very appreciated…
note: you will see that the first If condition is set to verify email attachments (Excel type).
Then, i am expecting to use and Else-Iif nested where a want to set condition for subjects string . at this point i dont know how to set all the types of string i need to verify … and then the other problem is how to follow to the next step that is: to check if attachment’s name comply with string types…
Hello @Marco_Ber and thanks for messaging,
in fact, i have a long list (types of string) to verify not only in the subject area or the name attachment. Therefore, i had in mind two options (it is how i see and maybe i am not in the correct path to solution)
first option: i use if in each type of string, but it would make a very long nested algorithme. However it would work correctly with both filter subject area or name attachments …
2.-second option: Use a switch , but i dont know if it would work because i have two types of cases (subject verification and name attachement) … at this point i am new here and i dont know how to use it and if it is possible…
any idea or photo example would be very appreciated… thanks
But I mean, what would be the issue with using a bunch of AND in your IF condition? Nesting a lot of IF and having one IF with AND is practically the same (in this case)
As you can see, we can keep it very short. Similar we can setup also the attachment check.
As a variation we can fillter also the arrMachers on present tokens and unsing the filter result for checking if the present token is matching the attachment name