O365 Activities - Get Mail

Hello All,

I am using Microsoft o365 activities - Get Mail inside Microsoft Office 365 scope.

It helps me retrieve all messages.

However, I need to retrieve only those emails which have an .xlsx attachment and has ‘Peer review’ in the Subject.

Subject can be: Peer Review test, Peer review automation request etc.
But ‘Peer review’ will always be there.

I used this "“subject eq ‘Peer Review’” - but it does not work for subjects containing other words apart from Peer review - Also, need to use the attachment filter.

Any advice would be appreciated on how to achieve both.

Thank you,
Gopal Pai

Hi @gopai

Use ‘has’ instead of ‘eq’ and that should solve the subject part.
Or you can also use contains(subject,’Peer Review’)

For attachments use - hasAttachments eq true

Cheers

contains(subject,“Peer Review”) And has attachments eq True

This is giving me a syntax error. Any thoughts?

Hi @gopai

It will because correct syntax is ‘hasAttachments eq true’ (no space between and these are case sensitive) use this exactly

cheers

1 Like

Hi @gopai

Is your issue resolved? If yes can you mark solution and close so that other can get help. Else happy to help

cheers

image

Not working, unfortunately.

Hi @gopai

place it between inverted comma please. query supports only strings

“hasAttachments eq true”

cheers

Hey Anil,
thank you so much!!

“hasAttachments eq true” works as expected.
How do I club it with my subject condition?

My subject line should have the 2 words peer review.

Thank you!

HI @gopai

use ‘and’ in between to club both

“subject has ‘ABC’ and hasAttachments eq true”

Or

“contains(subject,‘ABC’) and hasAttachments eq true”

cheers

I weote this - It gave me Bad response.

Hi @gopai

Please try it like this

“contains(subject,’Peer Review’) and (hasAttachments eq true)

If this doesnot work try interchanging the order or after getting emails we can loop and check hasattachments property separately as well

Cheers

Thanks a lot Anil - I just used the Attachment filter and then checked the subject line condition in a for loop.

Appreciate your help-

1 Like

Hi @gopai

Happy to know you solved your issue… could tou please mark the solution so that other can get help as well

Cheers

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