Problems with filter in Get Outlook Mail Message

I want to filter on from email sender

I have tried out the following, but they dont work.

“[From] = ‘Aaa Bbb’”
“[SenderEmailAddress] = ‘no-reply@microsoft.com’”

Can it have something to do with langue?

Hope the community can help me :slight_smile:

Hi @Anders_Dahl1

How about the following?
image

(From m In mailMessages
Where m.Sender.Address.Trim.Equals("yourAdrdress")
Select m).ToList()

If you are looking for SQL filter, here is the answer

Regards!

@Anders_Dahl1

Is that throwing any error?

or do you have any special characters?

can you try this

"@SQL=""urn:schemas:mailheader:from"" LIKE '%example@example.com%'"

cheers

cheers

Hi @fernando_zuluaga :slight_smile:

Thanks for your solution.

I want to do the filter in the Get outlook mail message.

But i will save your solution for future solutions.

Have you tried that?

Hi @Anil_G

Thanks for the suggestion. But this does not work.

I get 0 i counting from the list. The number that i tri to get i 2.

/Anders

Hi @Anders_Dahl1

did you check the number of emails that you are retrieving?

@Anders_Dahl1

Please try this…I just tested

"@SQL=urn:schemas:httpmail:fromemail LIKE '%xyz@gmail.com%'"

also make sure unread emails only if check or not

cheers

Hi @fernando_zuluaga

Yes i do.

I have 4 unread emails. Two of the has a emailaddress that i tries to filter on.

So i dont have any filter my counting gets 4.

So there is something wrong when i tries to filter on this emailaddress.

And i have tried som many thing today. So i really need the help from others :slight_smile:

Hi @Anil_G

This does not work for me.

This is why i think, if this can have something to do with the langue.

For example. Mailfolder = “Inbox” in normal. But i lives in Sweden and i need to type Mailfolder = “Inkorg”

Is the filter function in Get Outlook mail Messages deppended on what type of what verion i have under Dependencies like in the picture

image

Som my question is, do you think that i need to have earlier version in System.Activites for example?

@Anders_Dahl1

I tried with the same versions and it is working as expected

Can you show the configuration to check if there are any differences

cheers

Hi @Anil_G

What type of config do you mean?

@Anders_Dahl1

Like how you are trying to do and how does your outlook looks …and without filter are you able to get all emails…if so print and check how the email looks so that we can use the same way

Cheers

Hi @Anders_Dahl1

Can you check the language settings of your email account and ensure that they match the language used in your filter expression.

Thanks!!

@Anders_Dahl1

try with senderemail instead of fromemail

cheers

@Anil_G

I will try that. Thanks!

1 Like

HI
Did you get it solved?
I’m also having same issue. I filter and got nothing
I don’t filter I get all emails.
I know is not a language issue because I’m using English for outlook and UiPath