How to filter the outlook mails using IF condition without using For each loop

activities

#1

Can we filter the outlook mails using IF condition without using For each loop.?? Please help


#2

Hey @khan,
That depends on the condition you want to apply!


#3

Ok… I agreed Rishab. I want to filter my mail by subject. but to work with IF condition “For each” is required. My question is… is there any way, that I can use IF condition without For Each. I need to use like this… item.subject.contains(“Something”)… Kindly suggest… I dont want to run the loop. Aur loop is running, so I want to stop the loop once condition will fulfill.


#4

To go through the complete list you will have to use a loop!
Although, as you want to stop once the condition is fulfilled, just place a break activity in the ‘then’ clause of if activity
So when your condition is met you can take the necessary action and then immediately break out of the loop without having to go through the other items.


#5

Thanks Rishabh… Let me try this… Hope it will work


#6

It will for sure :slight_smile:


#7

How to read a single outlook mail at a time for a specific keyword?? How to filter or read single mail id from outlook. If I am using FOR EACH. I don’t want to iterate that much time , how much mails are available. Based on my condition, I want to read only single mail and want to stop . If more than one mails are available then how to read only particular mail at first only. Kindly suggest