How to use Get Outlook Mail Message filtering?

Hi Guys! Need to ask you guys for your help, which is my company ask me to get the outlook message inbox with this subject: Movie Line-up from… and need to be the top 1 as they don’t want to change or count the top message so is there any filter options for the subject? They don’t want to use the if condition too.

Thanks!

1 Like

Hi @phoenix123

Buddy

  1. use get outlook mail activity to get the mail and output as mailmessage type named out_mailmessage
  2. and mark the propertyies like Onlyunread and mark as read, that would read only unread messages and mark them as read once identified and topmessages as 1 that would read only first mail that is identified
  3. And here comes the answer for ur query, put suject filter in filter property like
    “[Subject]=‘[Movie LIne-Up]’”

Thats all buddy you are done
Cheers

1 Like

@Palaniyappan hey buddy is there anyway to get the subject to filter like if I have Movie Line-up from 28-Apr how to use any special character to filter Movie Line-up from… like I only need to care Movie Line-up from

1 Like

@phoenix123
Buddy in that case you can use if condition like this once after getting the collection of mails from get outlook mail message

  1. get outlook mail message with output variable out_mailmessage
  2. for each loop with input as out_mailmessage and type argument as mailmessage
  3. use a if condition inside the for each loop like
    item.subject.Contains(“Movie Line-up”)
    if this condition gets passed you can get whatever segment you want from that mail using a assign activity like this inside the then part of if confition
    out_mail_body = item.body.ToString

The reason why we cannot have such condiions in subject , is given in detail here for your reference,

Kindly let know whether the above mentioned condition works or not buddy @phoenix123
Cheers

@Palaniyappan hey buddy how to know the latest email with the specific subject? Means that my case I got lots of email but my company don’t want me to put top number of the actual email just put one to find the specific subject Movie Line-up from…

1 Like

you can enable the property onlyunreadmessage as check that would read only the unread recent message and enable the markasread as well that would make that as read so that when new mail comes next time, only that new mail willbe fetched or use certain filter conditions like if you know the time span

“[ReceivedTime] > '”+ DateTime.Now.AddMinutes(-5).ToString(“MM/dd/yyy hh:mm”)

I would recommend the first one buddy rather to the second one

Cheers @phoenix123

1 Like

@Palaniyappan hey buddy thanks for your reply unfortunately my company dosen’t want that because they tell me if they have many emails in the outlook, they just want this subject Movie Line-up from… and must be latest one using top 1 message options.

1 Like

@Palaniyappan hey buddy I really prefer the first one more logic to me but the subject can they have like "[Subject]=‘Movie Line-up from*’ " Got any clues on that?

1 Like

buddy … you cannot use wildcard with outlook properties in filter rather you can use conditions like this
item.Subject.Contains(“Movie Line-up from”) or item.Subject Like “Movie Line-up from*” inside the workflow

Thats is how it is done buddy @phoenix123 and it is more reliable and stable method to check with subject and retrieving the mail

Cheers buddy @phoenix123

1 Like

Were you able to get now buddy with the mail you want

@phoenix123
Cheers

1 Like

@Palaniyappan my activity can work but my colleague tell me wrong if next time I installed on their machine and when they run confirm get error as their outlook email really a lot so that’s why they try to get the specific subject and must be latest one using top one.

1 Like

buddy @phoenix123

So the mails willl be always in order like recent first and remaining next to each other right
ok

  1. get outlook mail activity to get the mail messages in collection with onlyunreadmessage and markasread both checked i.e., enabled
  2. inside a for each loop pass this out_mailmessage as input and change the type argument as mailmessage
  3. use a if condition inside the for each loop
    here comes your solution
    in the if condition we will be mentioning like item.subject.contains(" Movie Line-up")
    if this is passing it will go to then part right…?
    so inside the then part we get the details of the mail " 2. Movie Line-up from 2 May"
    as it iterate through the out_mailmessage variable inline
    once after getting the details in then part of if condition we can use Break activity,
    so that once the condition is met and details obtained loop will get over and thus workflow gets over like this, it wont even go for " 3. Discipline matters"
    image

This is reliable, isn’t it, wont miss even a singlemail

Cheers, buddy try this and let know

Buddy If this make sense and got resvolved
Kindly close this thread with right comment marked as solution that could help others looking for solution buddy

Cheers @phoenix123

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.