Populate the 'to' field in Email Client template

russellprice
Tera Contributor

Hi

I have setup a Client template for incidents which uses a script to populate the email client (envelope Icon) with details of the incident. I would also like to automatically populate the the 'to' field with the owner of the selected CI in the incident record. The problem is, no matter what I do I cant seem to script anything that populates the 'to' field?

I suspect the 'to' field in the email client cant be populated with scripts? and the email address must be entered directly?

Can anyone suggest a way round this? I really need the email client 'to' field to be dynamic.

Thanks

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

You can do this with an email client Template from System Policy> Email> Client Templates.

 

You can dot-walk to your email field through any field on the form. Example from Customer Service:

 

find_real_file.png

 

Docs: Create an email client template

View solution in original post

17 REPLIES 17

Hi Ashutosh

Thanks for your reply, unfortunately neither of the above answers work so I will attempt your script include method.

Im afraid I am pretty new to servicenow and scripting though, would you be able to go into a little more detail please?

 

Also, it turns out the field i require isnt in the cmdb table its in a table called service_offering

You should still be able to dot walk it from the Incident table via the breadcrumb filter. As long as it is in one of the related fields.

This doesn't work for me in the 'To' field as 'current' is undefined according to the error logs. Is there a way to get the current record or sys_id? I'm trying to query associated records to build a cc list and I need the sys_id or current record to do this query.

Chuck Tomasi
Tera Patron

You can do this with an email client Template from System Policy> Email> Client Templates.

 

You can dot-walk to your email field through any field on the form. Example from Customer Service:

 

find_real_file.png

 

Docs: Create an email client template

Hi Chuck,

The field is on another table so i tried this:

But it doesnt populate the to field in the client: