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

Hi @Community Alums ,

 

it will check whether entered text has @runjay.com or not if find then it will return 0 else it will return -1 .

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @Community Alums ,

 

I would recommend to use OOTB variable regex validator (email validation) to validate if the entered value is a acceptable format of email and on top of that i would use OnChange client script that would validate to avoid suffix such as @gmail or @yahoo etc..

 

or you can also use a 1 script that can do all the validation as suggested by @Runjay Patel  🙂

 

I hope this help.

 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Community Alums
Not applicable

Hi @raj chavan @Sohail Khilji @Runjay Patel @Community Alums ,

I got a new problem now. The email can be relax.com or Relax.com.

Regards

Suman P.

@Community Alums 

Do you know which all doing can you accept , is there any fixed domain that you have ?

 

if yes then you can check if the entered email has one of the accepted domain in the list or array that  you create in the script..


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi @Community Alums ,

 

you just need to change from @@Runjay.com to relax.com and add or condition and add Relax.com rest other code would be same