Get a usernae from mail body and make it in a variable

hello,

So i try to get a user name from an outlook mail body which contains just:
image
so how can i get just “jbaur” , i did some steps of the workflow and i don’t know how i can continue
image

can someone help me please ! Thank you!

Hi @amougari,

I hope you are getting the message body as per the screenshot attached, all you need to do is getting the required value from the body string right?

Try this:

text_entier.Substring(text_entier.IndexOf("User name : ")+"User name : ".Length).Split(Environment.NewLine.ToCharArray)(0)

Hope this helps

3 Likes

You can also use String output of Mail Body and put it into Matches activity and use this expression:

(?<=User name: ).+

2 Likes

@HareeshMR thank you it works very well!! for you @Pablito i should learn more about RegEx Builder before trying your solution thank you!!

2 Likes

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