Condition - email body

Hi All,

I have to grab specific data from the email body.
Usually I have 3 rows
Invoice
PO
Ship date
However from time to time I might have between PO and Ship date ID number

Capturess

How I should write a condition to scrape ID number if it is available in the email body?

Thank you

1 Like

Hi

Welcome to uipath forum

Hope the below steps would help you resolve this

  1. Let’s take you have this input string saved In a variable named Strinput

  2. Then use a IF condition like this

Strinput.ToString.ToUpper.Contains(“ID NUMBER”)

If true it will go to THEN part where use a assign activity like this to get the value

Stroutput = System.Text.RegularExpressions.Regex.Match(Strinput.ToStrinh,”(?<=ID number:).*”).ToString

Cheers @Malgorzata_Niteckakubicka

What if I was using SaveforLater activity to grab information from each single line. And now what if sometimes I have this ID number or not?

Gosia

That’s why we are using IF condition

Only if it’s true it goes to then block where we wil be trying to get the value
Or
It will go to ELSE block where we leave it empty without any activities

Cheers @Malgorzata_Niteckakubicka

So after one of the ‘Save for later’ I have to use If condition?

Exactly before using the above expression use a IF.condition like this

Here Strinput is your input variable
Replace with your variable name accordingly

Cheers @Malgorzata_Niteckakubicka

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.