180
Views
6
Comments
Solved
How to validate email address for specific domain like user can enter only @gmail.com

How to validate email address for specific domain ? like user can enter only -  xyz@"gmail.com", in outsystems reactive application. I want to validate email address. User cant enters the email address anything without gmail.com...

2026-03-12 06-20-48
KUNDAN CHAUHAN
Champion
Solution

Hi Shilpa ,

for this we can use regex for validate specific domain .

Regex : [a-z0-9]+@gmail.com

Demo Url : https://personal-x1ixzlcz.outsystemscloud.com/APITEST/regex?_ts=637978157912087462

also attaching oml please check it.

Thanks 

EmailValidate.oml
UserImage.jpg
Shilpa D

Thank You for your reply, your solution is working.

Thanks once again.

2026-03-12 06-20-48
KUNDAN CHAUHAN
Champion

Glad to help you .

Kind regards ,

Kundan Chauhan

2024-10-16 11-59-48
Nick Vandebriel

Hello Shilpa,

You could use an index like below:

If(Index(Email, "@gmail.com") > -1,True,False)

This wil look if the email address contains "@gmail.com"

Hope this helps,

Kind regards

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

In general, avoid If-s that only have "True" and "False" as result. This is superfluous

Index(Email, "@gmail.com") > -1 

as it already returns True or False, no need to put an If around it!

2026-03-12 06-20-48
KUNDAN CHAUHAN
Champion
Solution

Hi Shilpa ,

for this we can use regex for validate specific domain .

Regex : [a-z0-9]+@gmail.com

Demo Url : https://personal-x1ixzlcz.outsystemscloud.com/APITEST/regex?_ts=637978157912087462

also attaching oml please check it.

Thanks 

EmailValidate.oml
UserImage.jpg
Shilpa D

Thank You for your reply, your solution is working.

Thanks once again.

2026-03-12 06-20-48
KUNDAN CHAUHAN
Champion

Glad to help you .

Kind regards ,

Kundan Chauhan

2025-09-09 09-52-32
Bala Subramanian

Hi,

We can also use a Javascript function and add 

  • var rg_exp = /@gmail.com/
  • $parameters.Out1 = rg_exp.test(String($parameters.Email).toLowerCase())



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.