Email validation *@company.com

Community Alums
Not applicable

Hi,

I have a requirement that the email service catalog variable should accept only the *@company.com format, where * can be any name. It will not accept @gmail, @Yahoo, or any. Kindly help.

Regards

Suman P.

1 ACCEPTED SOLUTION

Rohit99
Mega Sage

Hi @Community Alums ,

You can create Regular expression in ( question_regex ) table. As mentioned below.

 Expresssion : ^[a-zA-Z0-9._%+-]+@testcompany\.com$ 

Rohit99_0-1731915795745.png


Now in catalog item select single line text as  a variable and in Type Specification section there is field called validation regex in that select regular expression which you created above in question_regex  table.

 

Rohit99_1-1731915981831.png

 

Please mark my response as correct and helpful if it helped solved your question.

 

Thanks,

Rohit Suryawanshi

View solution in original post

13 REPLIES 13

Hey, you can use OR condition in your script suitable to your usecase

if (email.indexOf('@runjay.com') == -1 || email.indexOf('Your condition') ){

}

 

Kindly mark it correct and helpful if it is applicable.

Thanks,

Raj

Rohit99
Mega Sage

Hi @Community Alums ,

You can create Regular expression in ( question_regex ) table. As mentioned below.

 Expresssion : ^[a-zA-Z0-9._%+-]+@testcompany\.com$ 

Rohit99_0-1731915795745.png


Now in catalog item select single line text as  a variable and in Type Specification section there is field called validation regex in that select regular expression which you created above in question_regex  table.

 

Rohit99_1-1731915981831.png

 

Please mark my response as correct and helpful if it helped solved your question.

 

Thanks,

Rohit Suryawanshi

Community Alums
Not applicable

Hi @Rohit99,

I like your approach. Where did you write 

 

where.png

 

Also my requirement is to accept suman@company.com or suman@Company.com

 

Regards

Suman P.

Table name  : Questions Regular Expressions (question_regex) 

Rohit99_0-1731921508983.png


My requirement is to accept suman@company.com or suman@Company.com 
For this you can write the following expression:
^[a-zA-Z0-9._%+-]+@company\.com$|^[a-zA-Z0-9._%+-]+@Company\.com$

 

Please mark my response as correct and helpful if it helped solved your question.

 

Thanks,

Rohit Suryawanshi