How to set Email Variable to accept multiple entries

Dee00
Tera Contributor

Hi Devs,

 

Looking for advice on how to change this field to accept and validate multiple email addresses:

Dee00_0-1678779567756.png


My thoughts are:

  • Keep variable type = "Email" but enable user to enter multiple email address (not sure how this can be done)
  • Change variable type to "Multi Line Text" but write a script that validates every entry to ensure it is in email address format
  • I though of changing it to list collector, but this won't probably suit as the field should be able to accept email addresses regardless of domain

Relatively new to all this (1 month in) and really enjoying learning! Also glad to see all the resources available here and to see such an active and supportive community.

 

Looking forward to any advice and thanks for your time 🙂

 

Dee

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Dee00 

I will go with 2nd option.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks Ankur! Any advice on how I can do this? 🙂

@Dee00 

inform user to enter email address separated by comma.

have onChange client script on that variable and get individual email addresses and validate them.

show alert to user saying which email address is invalid.

you can easily find email validation regex on community or in google.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader