GetMail activity returns more values than expected

Hello,

I am using a GetMail activity inside a Microsoft Office 365 Scope.

For testing purposes I have sent to myself two emails and want to return an exact number of 2. However the GetMail activity returns 6 .
image

I am searching my “Sent Items” folder in Outlook:

image

And these are the properties of the GetMail activity:

Any help would be greatly appreciated!

Hi @dbukk ,

As per screen shot you have configured to get top 50 mails irrespective of read or unread so bot will fetch all the mails first 50

If you want to get only unread mails then you can specify in the properties or you can decrease the no of mails, so that bot will retrive accordingly.

Hi @Mohan_Reddy

But as you can see I have a query parameter configured. So my understanding is, that I’m querying through 50 top bot read and unread mails and want to retrieve the emails that comply to the query parameter.

Hi @dbukk

Is there more than 6 mail in Sent Items? If so, the query is working and probably you have more than 2 mails that Subject contains your str_MailSubject variable value.

Could you check your Sent Items folder ?

Cheers

@dbukk

So your configuration works as below

First it will get all the mails that satisfy the condition of the subject…and then it gets the top 50 mails of it…I believe may be in older emails you have some emails matching the subject so it is getting 6 as only 6 are matching

It is not like only from top 50 it tries to search for filter…but it is other way round

Cheers

Hello @Anil_G and @rikulsilva

There are more than 6 mails in the Sent Items folder. I have only 2 mails with the subject that I am searching for.

My requirement worked correctly with the Get Outlook Mail Messages activity. Maybe it would be more reasonable to replace Microsoft Office 365 Scope Get Mail activity with the Get Outlook Mail Message? Will it work for shared mailboxes?

image