- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2013 10:31 PM
Is it possible to retrieve the watermark reference # on the notification through mail_script code? I need to generate a link in the notification that, when clicked, will generate a reply email with the watermark reference # from the original email for the inbound action to work properly.
I cannot use a "mailto:" template for this because the reply email address may not necessarily be instancename@service-now.com. The reply address depends on the user's company. I can build the proper link if I can retrieve what the watermark reference # will be for the notification.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2014 10:55 AM
Found out that you can actually use...
email.watermark
...within some mail_script code to get the watermark.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2015 04:52 AM
Strange! I tried using the same code excluding the gr.number under Notification, and it shows up as undefined again
I gave a try from notification email scripts as well after removing the <mail script> tag and gr.number, it shows as undefined again.
I am using Eureka instance.
Any idea?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2015 05:33 AM
Hi Ashwani,
I don't believe any code will work in an email notification body without wrapping it in <mail_script> tags. My client is running Eureka also and the code is working for them so I don't think the SN release has any effect.
Are you able to query the Watermark (sys_watermark) table to find watermarks for the record your notification is acting upon? If the watermark has not yet been added to the Watermark table, then I don't believe email.watermark will contain a value.
However, I'm no expert in this area. I have performed a few experiments with different ways to get a watermark into a notification, but I have no particular expertise. @Mike Kaufman's earlier reply reflects behavior that I noticed during some of my experimentation. To wit, there appears to be a timing issue that impacts when the watermark is actually generated. It's possible that your mail script is attempting to extract the watermark from the email object before it has actually been added to that object.
One thing I failed to mention in my earlier reply is that my mail script is contained in a template that I'm using on my notification. I don't know whether putting it in a notification template impacts the processing order, but it might be worth trying to put your code in a template, then reference that template on your email. Also, note that in my case the notification is always being sent from an existing record which has been updated. It will never be sent from a newly inserted record. I don't know if this would have any impact on your situation, but if there is a timing issue with generating the watermark, it may be affected by whether the notification is being sent on insertion of a new record as opposed to updating an existing record. That's just supposition on my part, though.
Hopefully someone out there with more experience working with watermarks may be able to provide some additional information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 04:33 AM
Hello Jim,
I have a similar problemAdd watermark to subject in Email Client Template
, could you pls help give me some advice? Thank you in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 06:18 AM
Hi Jeff,
I think the Email Client Templates work differently than the notification emails. I don't believe that a watermark has been generated at the time the email client is displayed, so I don't know of any way that you could display the watermark in the subject line.
You might be able to run a business rule on the sys_email table to modify the subject line of the email after it has been submitted. This article in the excellent SNC Guru blog that might help lead you in the right direction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2016 01:48 AM
Hi Jim,
Appreciate your help! The link is much helpful!