How to keep only certain elements


#1

Untitled1
Hello … In Input dialog box asking for email address . we give user input like abc@gmail.com or abc1@yahoo.com or abc@123.com or abc@outlook.com and so on … then how to set condition to accept only @gmail.com or @yahoo.com … when we type abc@gmail.com or x..z@yahoo.com then it should proceed to next step . also when we type abc@outlook.com or any keyword with @123.com it shouldn’t accept then again it go input dialog for asking enter correct email address… how to do this ?


#2

pass email ID into a Global Variable use AnotherString = InStr(GlobalVariable,"@gmail")
NewString = InStr(txt,“SearchKey”) - use this as if statement condition and pick the variable value for all Gmail IDs

Hope my inputs are useful


#3

Type your email address in input dialog box and use Split operation to Split ur email address…

Use variable.Split(New Char(){"@"c})
The about code will split ur email address like this “abc” “gmail.com…And check whether the second part of the string is belongs to “gmail” and “yahoo”.

If ur input email ID is belongs to the above list it will go to next step, Otherwise return back ur Input Dialog box.

Regards,
Poovarasan Guna.


#4

tried didn’t work … can u please pass me practical work flow i m begineer :sweat_smile:


#5

Hi,
Here we go.
MailIDValidation.xaml (11.6 KB)


How to pull out Regex groups in UiPath Seperately
#6

Thanks @ddpadil


#7

Hi @ddpadil

How is the UI path way to check if Email is valid or not , it may be for any domain just a format check.

Rgds
Aditi