Getoutlookmailmessage

Hi All,
“Get Outlook Mail message” activity reads only the 2nd mail instead of reading top 2 mails, can anyone tell me why and how can we resolve this?
A uploading the file here
Subjectbased.xaml

Hi @u322805,

By seeing at your workflow if you are reading the mails which are unread then
check the onlyUnreadMessages checkbox in properties panel.

Regards,
Aditya

How many emails are in the inbox where the second email is read? I believe the send outlook activity retrieves the newest email first. Even if your inbox is sorted another way, it still will pull the newest email. Since you have a “Top” value, if there are more than that number of emails, it could look like the first one was not worked say if you sorted oldest first in your inbox.

Nope it has to read all the emails

Many emails are there, it picks the 5th mail only (from newest to oldest hierarchy) instead of taking it one by one

@u322805 I checked your code. Basically, you have assigned variable “subjectsentmail” with the subject of sent mail. Though it retrieves subject of first two mails, it seems that first one is getting overridden by the second mail’s subject. Whatever you were trying to do with the subject, do at the same time when you are iterating through the sent mails and saving the subject into the Variable. For this you can place the 2nd loop within the first.

Mark this as solution , if it helps :slight_smile:

1 Like

Can you please loop it and post the file, will check

@u322805 - Please check the properties of the activity. Did you check the Unread mail only property. Or save the mail in a variable and try to iterate each mail using For Each loop or use .Count() method to find the count.