MS O365 Get Mail - Filter for From field

Hi folks,

I am facing the challenge to filter the mails I would like to proceed with the O365 avtivity “Get Mail” for mail addresses that conatins certain strings.

The examples that are mentioned in the official documents here
UiPath.MicrosoftOffice365.Activities.Mail.GetMail
just mentioned the full from-address like

  • “from/emailAddress/address eq ‘someone@company.com’”

But how can I filter/use the query using “contains” for the from-address?

I already achieved to filter the subject with the following query

“contains(subject,‘blablabla’)”

But if I try to apply this to the from-address, it does not work. :frowning:

Thanks for any advice and help.

Yours

1 Like

@mbe

Can you check as below for contains in From-address

“from:contains(‘blabla’)”

Hope this may help you

Thanks,
Srini

Hi @Srini84 ,
thanks for your reply, but this does not works for me. It causes the following error

Get Mail: Code: BadRequest
Message: Invalid filter clause
Inner error:
AdditionalData:
date: 2023-04-24T09:21:46
request-id: d576ff6f-1b5f-4f97-a8d3-f8e2169eddb2
client-request-id: d576ff6f-1b5f-4f97-a8d3-f8e2169eddb2
ClientRequestId: d576ff6f-1b5f-4f97-a8d3-f8e2169eddb2

Any other suggestions?
Yours

Hi

When it comes to Address It is recommended to use only FROM Clause instead of Contains
But for the one partially known u can still use From with wildcard symbols like this

“From:‘*@example.com’”

Try using like this based on ur condition or value

Cheers @mbe

Hi @Palaniyappan ,

I am really sorru, but this phrase also does not work. The error message stays (nearly) the same

Get Mail: Code: BadRequest
Message: Invalid filter clause
Inner error:
AdditionalData:
date: 2023-04-24T12:19:23
request-id: 029c6ca2-5ec6-4f69-8188-ccc0add791a1
client-request-id: 029c6ca2-5ec6-4f69-8188-ccc0add791a1
ClientRequestId: 029c6ca2-5ec6-4f69-8188-ccc0add791a1

I use this package
image
with an Studio 2021.10.5

I tried also ‘from’ and ‘From’ as it may be case sensitive, but the error occur with both. :frowning:
Yours

Hmm this should work ideally
Did u try to type the same on ur own
Because sometimes quotes direction might change on copying

@mbe

Yes, @Palaniyappan I did, as you can see here

But still no improvement.

Hmm
Double quotes looks in different color isn’t it
@mbe

I totally agree with you, and as I retyped it from scratch the colours changed as follows

But still no changes concerning the error message

@Palaniyappan I am really sorry

Hmm
Can we try with this

“contains(from/emailAddress/address, ‘your text’)”

@mbe

1 Like

Good morning @Palaniyappan ,

that is now working like a charm :partying_face:

Many thanks for patience, help an assistance
Yours

1 Like

Glad it got resolved @mbe

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