- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 04:26 AM
Is possible to set custom values in Email Client Template in To field using script includes?
I already tried, and getting like current is undefined?
Solved! Go to Solution.
- Labels:
-
Notifications

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 04:32 AM
Greetings Milo,
The email client template system doesn't use the current.fieldname - instead it references the fields without current. This would seem to preclude the use of script includes that rely on using current object. Docs
-Andrew Barnes
Join me at Developer Blog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 04:32 AM
Greetings Milo,
The email client template system doesn't use the current.fieldname - instead it references the fields without current. This would seem to preclude the use of script includes that rely on using current object. Docs
-Andrew Barnes
Join me at Developer Blog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 05:16 AM
I wanted to calculate TO fields based on some parameters in script include. Is that possible?
Concrete, email client template is related to sys_email table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 05:41 AM
You can add a mail script to your template that sets "To"-fields.
Is that enough? It will trigger on opening the email client, so you should know already then what data you are looking at. And mail script can see "Current" and then talk to script include.
I have some pointers on Notification Email Scripts here:
https://community.servicenow.com/community?id=community_article&sys_id=054deee5dbd0dbc01dcaf3231f961912
And I've done something similar to what you want, but I got my addresses from a comma-separated string with a few bits and bobs in one of the parameters, that I then used for, among others, setting addresses in To-field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 05:59 AM
When I receive mail, it update incident. And I have option to reply all on that email. So I wanted email client opened that way to script and put some values in TO fields. I tried to put in TO field javascript: new ScriptIncludeClass().function(), but not good. current is undefined that way.
Did I explained as well?