- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2019 09:57 PM
What are the equivalent variables in email scripts?
Fields in sc_request table can be easily accessed from workflow or notification, but how to access them in email scripts?
For example:
In notification: ${sysapproval.description}, ${sysapproval.short_description}
In workflow script: current.description, current.short_description
In email script: ???, ???
They all correspond to the description or short_description column in the sc_request table. What is the equivalent of them in the email scripts?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2019 11:13 PM
Dear Mr. Harshvardhan,
Thank you for your help. The following code is working. I can read the sc_request table columns.
You are great.
Liuduan
var req = new GlideRecord("sc_request");
req.addQuery('sys_id', current.sysapproval.sys_id);
req.query();
gs.info("test 1: ");
while(req.next()) {
gs.info("test 2: " + req.short_description);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2019 11:32 PM
This line in above code give me hundreds of answers, and some of them are right answers.
req.addQuery(current.getUniqueValue());
This line in above code do not give me any answer:
req.addQuery('sys_id', current.getUniqueValue());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2019 11:12 PM
I am sorry, the same result as last time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2019 11:13 PM
sc_request table seems have two sys_id columns.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2019 11:19 PM
I called the mail script in the email template like this:
${mail_script:my_email_script}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2019 11:31 PM
can you add screenshot here , how are you checking the output. did you use template.print() instead of gs.info().
please add some screenshot here. and your notification is running on which table ?