Unable to read emails based on criteria

While I am trying to read all emails using GetOutlookMailMessage > Loop through ForEach > Find emails from specific person > UIPath Studio shows object reference not set to an instance issue. Please help. Attached screenshot.

Welcome to uipath community
The condition be like this

Cheers @vchandu

Hi vchandu,

  1. Check if ‘item’ datattype is set to messages correctly. On click of for each activity, on right side you will be able to see the datatype of item variable.

  2. Make sure, Get Outlook Message activity’s output is set to variable messages.

  3. Make sure message variable scope is correctly set.

If above three points are correct, issue will be fixed.

1 Like

Hi Arun,

I have already set the above mentioned points in the properties, outputs & scope.

in IF, use: Not item.From Is Nothing And item.From.User.Contains(“emailToFind”)


then, messages does not contain any mails . i.e, either the variable in get Outlook message is wrong or it is null/not instantiated.

Could you check if Get Outlook Mail Message activity is returning any output? if possible post a screenshot of getOutlook Mail message activity configuration

1 Like

Thank you Palaniyappan, ArunVelaayudhanG, bcorrea for your suggestions.

Issue got resolved, it was problem with donotreply email in my inbox.

1 Like