How to get specific value from the body of mail



I am working on UiPath and i want to extract specific value from body of mail . Below is body of mail look like
In this image I want the Full Name after Quicklook id i.e Johnson, Kim and kj250158 and want to store full name Johnson, Kim in separate variable and kj250158 in separate variable.
If you can please help me through this.


Hi @programmer,

you can take body message into a string variable then do simple string manipulation as below

1.str = bodyStr.substring(“Quicklook ID:”) , it would return string after this “Quicklook ID:”.
2. str2 = str.split(’ 'c)
3. str2(1) will be first name, str2(2) will be last name and go on

Hope it will help

Best regards,


Hi Avi,
Thanks for replying. When I tried your solution i faced one problem. Firstly i am explaining workflow which i used msg as a variable in for each such that for each msg in mail then in for each loop i take string variable var1= msg.body.tostring.substring(" ")
Then i am getting error option strict on disallows implicit conversion from ‘String’ to ‘Integer’. I am enclosing the error please help on this


Hi Avi,

I even tried taking mailbody as String but still error persists.


As per image change “mailbody” type from “GenericValue” to “String”


I have one question if the body of mail looks:
**Additional Administrators:

Full Name: Bisen, Madhuri ; QuickLook ID: Mb185076

Full Name: Garg, Neha ; QuickLook ID: ng250098

Full Name: Hughes, Wesley ; QuickLook ID: Wh185051

I** want to store **Bisen, Madhuri in separate variable and **

Mb185076 in separate variable similarly i want to get

**Garg, Neha , **
ng250098 and then **
Hughes, Wesley , **Wh185051 ********

If you can help me through this , it will highly appreciable.



Kindly find attach solutionemail string1.xaml (8.6 KB)
emlstr as emailbody, add to your datatable each name and id


Hi @Atrimal

Can you please explain logic of while condition

ind<split(emstr,“Full Name:”).Length-1

Code is working fine but I’m not getting logic of above condition


ind<split(emstr,“Full Name:”).Length-1
Here split is a function of string where it is used in two ways :

One way act as a substring to find that particular string full name in emstr

In next way it extracts that string full name from emstr

We used Ind as index of mail we check that Ind is less than length of extracted string full name .