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

Hi Nabilo can you share the solution that you found?

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