O365 - Get Mail - Query - body contains - Code: BadRequest Message: Invalid filter clause

Hi,

I have a problem with the Query command (in Get Mail activity for O365).

I was able to use it for the subject of the e-mail (“contains (subject, [XYZ])”,
but I can’t get it right for the body of the email (eg “contains (body, [XYZ])”.

How should I build this query to be able to filter emails by their body containing given value?

Hi @Lukasz_S,

Please check this topic. Microsoft Office 365 - Get Mail Activity Queries to filter returned emails

It should help.

Regards.
Ömer

4 Likes

@Lukasz_S

Welcome back to our UiPath community.

Try below expression.

        "contains(body/content, 'body you are looking for')"
1 Like

This is great. Thank you, Ömer!

[ Microsoft Office 365 - Get Mail Activity Queries to filter returned emails ] This is a great guide, lakshman. Thank you for it! :slight_smile:

1 Like

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