Filter outlook mails by mailID

Hi all.
I have a scenario where i have to filter those mails of which mail unique ID is equal to the value which I’ve stored in a variable.
i’m using this filter in get outlook activity - “[MessageId]=”+“'”+ID.ToString+“'”
but getting an error saying MessageId property is not found.
Please suggest which mail property should be used.
Thanks in advance.

I hope its Message-ID or may be Message-Id

Cheers @Shree_Vybhavi

I’m still getting the same error.:frowning:
“Message-ID property is unknown”

hello @Shree_Vybhavi

use From and try , i am not sure its just an idea

Regards
Ajay

Hi @Ajju , i want to filter using uniqueID of mail message , i don’t want to filter with from address.

Hi @Shree_Vybhavi,
Use ‘Filter’ box option in ‘Get Outlook Mail Messages’ activity and use this below condition -
"[From]=‘MailSenderID’‘’

Thanks & Regards,
Apurba

I tried both…
it didn’t work.

I have a similar need and can’t get the filtering working. So as I workaround, I found this custom activity that allows you to retrieve an email with its UID.
https://connect.uipath.com/marketplace/components/outlook-mail-activities-4dbc88

@scottl I tried that activity but still unable to retrieve mails. I have provided string input (eg: “24899” as UID in the mentioned activity). @Palaniyappan @Shree_Vybhavi Did you got solution how to get mails by UID? I have UID in queue so needed to use this method.

You can use item.Headers(“Message-ID”) to fetch unique reference for an email which can be added to queue and later used to retrieve same email in get outlook mail messages filter activity


Min package for mail activities required is - Version 1.10.4

1 Like

I am trying to filter by passing the message ID in above way but getting zero mail items as output. Could you please provide the other properties details with you set along with FilerByMessageIds?

Hello,

I have managed to filter by using FilerByMessageIds following this steps:

  1. Get outlook mail messages, with only the Top Filter set, output to TransactionData (as List< MailMessage >), where i get only top 5 emails
  2. In for Each ‘email’ (as MailMessage) in TransactionData (as List< MailMessage >)
    a. create a new variable named ‘MessageIds’ type String [ ], an declare default: ‘New String(){}’
    b. in assign activity: MessageIds = {email.Headers(“Message-ID”)}
  3. Get outlook mail messages, with filter by using FilerByMessageIds = MessageIds, to retur/filter only my last email (from the prev 5 above)

Hope this helps

U can use MailMessage.Headers(“Message-ID”) for retrieving message id of a mail after that u can passit to filterbymessageid as a {" "}

In first image which activity you use to get messageid ?