Query parameter to fetch mails with PDF attachment only in GetMail activity


I am new to UiPath and have been trying to get the mails that contain PDF attachment only from outlook. Other mails that do not have PDF attachment should not be returned. I am trying to use GetMail activity of MicrosoftOffice365 and need help to provide this filter in query property. I came across this query( /me/messages?$search="attachment:api-catalog.md") in Use the $search query parameter in Microsoft Graph - Microsoft Graph | Microsoft Learn but not able to use it. Please guide.

1 Like

Hey @Meghna_Jain

Try using the below syntax please…

attachment eq 'api-catalog.md'


Hello, Thanks for your reply. But its not working. OData parameter must be followed it seems.

do we have any update?

i have same scenario.

Hey @venkat4u

Try using only the name of the file !


Hello @venkat4u

Can you refer to the below. Instead of excel replace with the pdf. Then check for the folder for the attachment. If file saved, then for that particular email or item you can use to read.


Thanks for response :slight_smile:
But my query is more like while fetching Email itself can we apply filter?

hi, the query thing for attachment didn’t work for me. I could make the query work for getting mails from specific sender, after that I looped through the output to get the attachments whose name contained “.PDF” in it.

1 Like