How to Convert Names in Email Adress

Hello!

I’m using the command “Input Dialog” to ask for a user what e-mail adress the user can send a email.

But, on my test, I need write the complete email adress, like "test@test.com", but I want write just the name of my contact, and the UiPath convert this name on a email adress, for example: If I write “John”, the uipath uses the email adress "john1233@test.com".

You can help me?

1 Like

So u want to concatenate always "1233@test.com" to the name of the contact?

Hello @guiggs

No, i Want use the command like that “Assign”, to convert a Name in e-mail adress.

Like

Arthur = arthur.test@test.com

Hi @arthurfsantos11!

So if u do an “Assign” u can to that. Like:

Name = Arthur
Maiil = Name.toLower +".test@test.com"

But, if I have a list of contacts, how that I can assign this contacts?

Ah!

Alright, so if u have, for instance an Excel with the name and the emails, u just have to ask for the name of the contact.
After that u iterate throw the data table or the array, and if the row have the same name that the name that the user inserted, the email it’s that one

Hello @arthurfsantos11

Try this way:

String nameEmail = "john1233@test.com"
string Array arrName = nameEmail.Split("@"C)
nameEmail = System.Text.RegularExpressions.Regex.Match(arrName(0).ToUpper.Trim, “^[A-Z]+”).Groups(0).ToString

You got just the name John.

Let me know if it working!

Hope it helps :slight_smile:

U can send me a example?

1 Like

See attached the example:

GetName.xaml (8.2 KB)

Thank you for your reply!

If I made a sheet on Excel listen column 0 (name) and column 1 (email adress), I can refer the column 0 and return the result in column 1?

Yes, I don’t if it clear for me, but do you need return the result “John” in column 1 (email adress)?

It’s opost, I need write John and return the email adress.

In this case, I’ll have the column 0 with name and column 1 with email adress.

Ok, So you can write the result in column “name” and your initial string that contains the email write in column “email adress”

DK,

U can send me a example for this?

1 Like

@arthurfsantos11

See attached
GetName.xaml (14.5 KB)
NameEmail.xlsx (8 KB)

DK,

I don’t understand how it works :confused:

@arthurfsantos11

The code get the information you need to write in excel file.

1- Get the name in email
2 - Create a DataTable with columns “Name” and “Address Email”
3 - Create a row
4- Fill the values in Datable through For each Row Activitie
5- Write the DataTable with the values filled in Excel File

Hello,

Below example may assist.

BuildEmailWithName.xaml (11.3 KB)

Cheers,
Pankaj

Hello Pankaj!

I’ll analyze your document.

Hello!

In my case, I’m have two names on email adress, like “John.Carter”.

I can ask for user write “John Carter” and the UiPath includes the dot between the names?