Validate multiple email addresses for Distribution List

Ajay1998
Tera Contributor

Hi community Team,

 

We have a multi line text variable field where users are entering emails like in below format:

abc@gmail.com
test@gmail.com


We need to validate if these 2 emails exist in ServiceNow if either of these emails are not there then it should be removed from the field and error message should display 'email address test@gmail.com' removed.
and field value should be replaced with the valid email addresses and there shouldn't be any blank new lines and spaces once the invalid emails are removed from field and replaced with valid email addresses.

 

Please help me to achieve this.

 

Regards,
Ajay

1 REPLY 1

Mayur2109
Kilo Sage
Kilo Sage

Hi @Ajay1998 ,

 

For this you can create one client script and client callable script include. You can pass the email addresses to script include and verify in user table if these email addresses exists, if not you can return answers as false and addErrorMessage on client script.

 

Please check and Mark Helpful and Correct if it really helps you.

Regards,
Mayur Shardul