How to use query for Office 365 Get Mail activity?

I am trying to retrieve email from Office 365 outlook.
I have already got it to retrieve all emails in the specified folder, without any problem. Now, I want to use the filter query so that I will only retrieve the following emails:

  1. emails whose subject line contains “examplePhraseA” or “examplePhraseB”.

  2. emails whose subject line starts with “examplePhraseC”

  3. emails whose email body contains “examplePhraseD”

  4. emails whose email body starts with “examplePhraseE”

I checked the URL provided, and it seems like I could use $filter=startswith( but I am not sure exactly how.
Can someone please help me out?

@tomato25 -
in get outlook mail message → properties → filter option

"@SQL=urn:schemas:httpmail:subject LIKE '%Your Item%'"
"@SQL="""" like '%Your Item%'"

pls refer below link for multiple filter options -

For Office 365 Activities use only filter in graph API query parameters

Example:$filter=subject eq ‘let’‘s meet for lunch?’

In UiPath just use it as:
“subject eq ‘let’‘s meet for lunch?’”

For anyone wondering how to search by body text, use this: contains(body/content,‘valueToSearchFor’)


I need the same but I need something like the following “contains(subject,‘P123’)” but I need another contains inside the filter and is not working.

e.g. My Subject: Filtering subject by the first letter ending with

I would like to filter If contains the first word and also If contains the email in the subject. Is this can be done in the filter of Get Mail activity office 365?


I want to filter using categories but i am not able to find correct filter

I am using “contains(Categories,‘xxxx’)”

Use this to filter out the From email address, Subject and attachment (True or False):

(from/emailAddress/address ne ‘FromEmailAddress’) and (startswith(subject, ‘YourSubjectFilter’)) and (hasAttachments eq false/true)

Thanks for response @Debasis_Nayak , I was looking for “Categories” Not for this.
As my requirement itself is perticular Category

Studio 2022.4.3
After a lot of trial and error, a case with UiPath, and interesting searching we found the best documentation (For for the query at: Use the $filter query parameter to filter a collection of objects - Microsoft Graph | Microsoft Learn
O365 V1.11.1 works with both of the following:
“contains(subject, ‘ICE’)”
But in V1.14.1 (and 1.16.1 prerelease) only the second works. The first one generates a BadRequest, Invalid filter clause.

All documentation is for Subject, From, and Category. I need other properties such as attachment content, received date, body content, etc. Is there a place where all properties syntax is found?


In case it helps, this is the Message model reference for the Graph API, with all the properties that you can include in the query predicate (subject, body, from, receivedDateTime, etc):

message resource type - Microsoft Graph v1.0 | Microsoft Learn

Also, this reference for the supported operators in ODATA queries could be useful:

Use the filter query parameter to filter a collection of objects - Microsoft Graph | Microsoft Learn

I have not yet found how to filter by the date of receipt too.