Hi. I want to do this. How can I do ?
Use a flow chart and loop back to check if unread messages by filtering the required email.And then put a condition to forward with your process if the mail is received. Or else keep on looping.
Use condition as mail.from.address.ToString.contains(“firstname.lastname@example.org”)
Then process it or else print it as “No email found for this address”
in for each loop ?
Yes in for each item
But I want to do this
If email@example.com sent me mail, read my mail
Else just notify me
If I do as you say,it gives me more than one notification if more than one mail come
For example there are 3 mail in my mail but only 1 came from firstname.lastname@example.org.
If I use this condition in the for each loop, robot will give me 2 notifications
Did you understand ?
- Using for each loop, loop through the mail messages .
- Add an if condition ‘mail.Sender.Address.Contains(" email@example.com")’ in the loop
- Maintain a flag say ‘blnMailFound’ and set it to ‘true’ if the condition is satisfied
- Once all the mails are processed, outside the loop check the flag value and if its ‘false’ (which means you haven’t received mail from specified sender), add notification
The condition is given by the other users are correct now you have top implement it with your logic suppose if the firstname.lastname@example.org sent you mail then read it and proceed further if not then as per the if activity it will go to the else part where you have to defined what you want to do whether you want to print or keep into the log.
It is simple If else logic, if you get mail proceed further else do nothing
if im wrong in understanding then request you to kindly elaborate your problem
Okay let me tell you what i want to do. I want to look all my emails and If I receive an email from email@example.com, I would like to read the mail at firstname.lastname@example.org and do the processing.If I have not received mail from email@example.com, I want to notify to me
One more way of doing it would be -
Add a filter like “[From]=‘[Mail address]’” in the Get Outlook Mail Messages activity.
This will filter out mails from the specified sender and check the count of the resulting collection. If its equal to ‘0’ ,it means you don’t have mail from the specified sender and add notification.
So how do I print this number on the screen?
The output of the ‘Get Outlook Mail Messages’ activity would be a List of MailMessage. Create a list variable say ‘lstMailMessages’ and assign it to the output. Check if(lstMailMessages.Count==0) ,if true then add notification.
The variable type should be ‘List Of(MailMessage)’. Do a Ctrl+K in the output to create variable of the required type.
try to loop them in for each item