Get Outlokk Mail Mesagge an dif

Hello everybody,
iam new in Uipath and i have a question. I want to check with uipath robot email in my inbox auf outlook.
Now i use the activity Get Outlook Mail Messages to get my mail messages . then i have a for each it should give me out the body of alle unreaded messages in the inbox.
how can i creat a variable of them.

I would like to use an if loop to check whether emails with certain content have arrived in the inbox


Thank you very much


you can use directly the variable mail.Body inside the For Each in order to check for a certain content.
For example you can add an If statement inside the For Each with something like
mail.Body.ToString.Contains(“Example Text”)

You can also use the filter function inside the Get Mail Message activity.
Kindly refer to this post, you just have to use Body instead of Subject

Can you make a example for me please.

Thank you

1 Like

Hey @wu1123,

PFA - (2.6 KB)

This may help you.

Thanks :slight_smile:

Looks great thank you. and the same with 3 ifs ? :slight_smile:
Thank a lot

1 Like

Sorry, 3 if’s ?

yes i want filter 3 different email bodys

1 Like

Yes you can do :slight_smile:

Can you please give me a example for that ? I cant solve it by myself.
In this 3 ifs it should check if there the names ( Mike, Frank, Gil) in the body.

Thank you very much

1 Like

So @wu1123, You want to check three words present in the email body. This is what I understood. Correct me if I’m wrong.

PFA optimised soln - (2.6 KB)

Hope this helps.

Let know for anyother issue.

Thanks :slight_smile: