Hi Amrit,

 

Yes, it is possible to restrict input email to a particular domain like "@abcd.com" in ServiceNow. One way to do this is by using a client script in the form of a script include.

Here's an example script that you can use to achieve this:

// Define the allowed email domain
var allowedDomain = "@abcd.com";

// Get the email field element
var emailField = g_form.getControl('email_field_name');

// Get the value of the email field
var emailValue = emailField.value;

// Check if the email is valid and belongs to the allowed domain
if (emailValue && emailValue.indexOf('@') > -1 && emailValue.split('@')[1] !== allowedDomain) {
  alert('Email must belong to ' + allowedDomain);
  emailField.value = '';
}

 

You can replace 'email_field_name' with the actual name of the email field in your form. This script will check if the email entered in the field belongs to the allowed domain. If it doesn't, it will show an alert message and clear the email field.

 

Thanks,

Rahul Kumar

If my response helped please mark it correct and close the thread.

Thanks,
Rahul Kumar