EMAIL IMAP IF Else .from .subject showing No item

Hello Rookies,

i am very new in UiPath.
objective: to read table in the email body sent by specific sender.

in for loop, if sender sent email > then copy the text(table) in her email.
i already set my for loop type argument as:
but still .from or subject still not appearing. what am i missing?

thank you to anyone that will give guidance.


1 Like

Welcome to uipath community
It looks good actually
Let’s do one thing remove that for each activity and place a fresh for each activity and pass the output variable of get outlook mail activity and change the type argument as SYSTEM.NET.MAIL.MAILMESSAGE and inside the if condition mention like item.From or item.Subject methods

To be very simple we can use this condition in the get outlook mail activity itself with a property called FILTER where we can mention likel this
“[From] = ‘your username’ “

This would filter in the outlook itself

Hope this would help you
Cheers @bri

i cant use outlook for now because we have office authentications before accessing our company outlook. that is why im trying in gmail for now.

1 Like

Heyyy @bri

Simple thing there, IF condition needs the boolean , but you are giving the string there , I mean mail.From is a string,

just complete it and check as

mail.From = “ and then check

Hi @bri,
Try using mail.fromSenderAddresss.contains(“your email id”)

Then we have two options here
If we have a username brimail with mail I’d like
Either we can use this expression like inside the for each activity
Where item is the variable from for each activity and FROM is a method mail.mailmessage class
And from method can take only the mailid username and not the mail id


We can mention likewise
Where senderemailaddress is a method that takes mailid and not the username of the

Based on the output Boolean that comes out of any of these two options it will go to THEN or ELSE part
Of if condition

Hope this would help you
Cheers @bri

my for loop cant recognize .From.ToString.Equals
this syntax. its saying “NO ITEM” thats the issue.

1 Like

No worries
Can I have that screenshot if possible
Cheers @bri

1 Like

this is resolved by.
removing the activity, and freshly assign the variables again.
assign in for loop.

this is the condition that work in my if else: item.From.Address.toString.Equals(“”)


Cheers @bri