Get "glide_list" emails separated by ";"

nabilo_
Giga Contributor

Hello SN Community,

I have been working on this for a couple of days but with no success. I have been asked to add a Button "UI Action" to CHG form to be able to send an email to the WatchList "glide_list". I managed to pop out the email form from the Button using the OnClick attribute: emailClientOpen(this, 'change');

I also managed to add the fields I need to a "Client Template" using ${CHG_Form_Field} which added the value of the fields to my email template as exactly as desired.

However, My issue is the fact that I need to add the extracted values "users and/or emails" of the WatchList "glide_list" to the "TO:" on the Client Template.

I believe the glide_list has the SysIDs separated by a comma ",". But I think in my case I need it to be separated by semicolon ";" to be accepted in the "To:" field of my Client Template. Or I believe I might need a contractor to populate the TO field with the values of my glide_list.


This is a Functionality/Feature that is highly desired and required in most implementations and configurations of ServiceNow, and it should be simple to deploy. The Functionality/Feature is to be able to Send an Email to the WatchList. Below is what I currently have in my Email Client Template:

MyList(${notification_contacts});
${u_notification_contacts}.MyList();
MyList('u_notification_contacts');
Change Request ${number} requires your approval

To1: ${u_notification_contacts} to SysID

To2: ${u_notification_contacts}.toString().indexOf("searchString")

To3: ${u_notification_contacts}.toString().indexOf("searchString"):

To4: MyList(${u_notification_contacts});

To5: ${g_form.getValue('u_notification_contacts')}

To5: ${u_notification_contacts}.MyList();

To6: Javascript: g_form.getValue('${u_notification_contacts}');

Change No.:[${number}]Parent Ticket No.:[${parent_ticket}]
Short Description:[${short_description}]

Description:

[${description}]

Any help with will be much appreciated to have and share better understanding on this subject matter.

Thank you and best regards,

Nabil O.

1 ACCEPTED SOLUTION

nabilo_
Giga Contributor

I found the Solution to my Issue, and like I expected, it was a very minor crazy missing semicolon.



I have been putting the WatchList Variable on the TO Field like:


MyList(${notification_contacts});
${u_notification_contacts}.MyList();

What I figured out from the Post: Enabling the Email Client - ServiceNow Wiki is the fact that we should not use the Variable on the TO, CC, BCC fields, instead, we should use just the field name like:


notification_contacts
requested_by

View solution in original post

6 REPLIES 6

Harish Murikina
Tera Guru

Hi Nabil,



                          Do you like to send notification to all glide list users at a time ? Instead of sending one mail to one person?. If yes how your trying to send , means what the event in this case.



Regards,


Harish Murikinati.


Thank you Harish Murikinati for your instant reply, I would like to send notification to all glide list users at a one time. Just a Template Email, that I have created, but in the TO field, I want to see all Users/Emails from the glide list.



This can be populated automatically from the the Email Template, or passed in my UI Action Button ObClick Attribute: emailClientOpen(this, 'change');



But I am not sure how I can do that.



Best regards,



Nabil O.


Then in email notification under who will receive tab , you can select that glide list it can send to them.


Thank you Harish I managed to find a solution. Thank you for your thoughts and ideas.