Email filter not working with unattended robot

I have an automation that reads emails with filter applied on email body “@SQL=urn:schemas:httpmail:textdescription like’%Account Request%’”. When executed from Studio , its works fine , retrieves email but when I deployed the same automation to an unattended bot and executes the process as job, its not finding the emails matching the filter.

Was not able to figure why, any help would be great.

Thanks

@SridharI - Are you getting any exception? or getting all mails without filtering?

@GBK- no error but not reading any emails. If I remove the filter and republish the package then it’s reading the emails when running from unattended robot.

Everything works fine when it runs from studio but the same package not reading emails.

It could be your search string variable related issue…

You can try to write a hard code search text to the filter -> publish -> execute and check…

"@SQL=urn:schemas:httpmail:textdescription like ‘%test email%’"

“@SQL=urn:schemas:httpmail:textdescription like’%Account Request%’” or **"@SQL=urn:schemas:httpmail:textdescription like ‘%test email%’" - tried both. Made sure there are unread emails with body contains Account Request and test email words . Its same behavior, first executed from studio, do see emails were read then published same and executed from unattended, then executed from unattended and it didn’t read emails (made sure there are unread emails in outlook).

Main.xaml (9.6 KB)

attached xaml file.

is outlook configured with the specified user in unattended robot user VM/machine?

Hi @SridharI, any luck with this issue? I’ve got the same situation: unattended bot can’t filter emails received.
No errors, just doesn’t work as expected.

Running in dev on studio it works.
It also works unattended if I have previously opened outlook on the VM even though the mail I want to retrieve isn’t read.
Outlook doesn’t need to be open during execution, it just needs to have been opened once before execution.

Only workaround I’ve got so far, is to place an open Outlook application somewhere before GetOutlookMailMessages activity, give the bot few secs to update inbox and then proceed with the outlook mail message activity and finally close Outlook.
It works but it’s bit of annoying and looks quite weak
Thanks

@dario_casubolo, in my case on unattended robot server outlook cache Mode is turned off because of that emails are not getting filtered on body. Once turned on cache mode , it started working fine.