Including Display Value of Fields from Other Tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 10:17 AM
I have a notification on the demand (dmn_demand) table in which I'm trying to include the value of a field from another table. I'm not sure of which table to use and am not sure if my script is correct. I created a mail script and am calling it from within the notification, but apparently I am doing something wrong. Below is my script and a screenshot of the data (category) in which I need to be included in the notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 10:40 AM
Hi @TStark ,
Can u try below code once
var gr = new GlideRecord('asmt_metric_result');
gr.addQuery('source_id',current.sys_id);
gr.query();
if(gr.next()){
template.print(gr.metric.category.getDisplayValue());
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 10:59 AM
Hi @Danish Bhairag2 I tried your script but it did not work. Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 10:46 AM
@TStark Update your code as follows.
(function runMailScript(current, template, email, email_action, event)
{
var demand = new GlideRecord('asmt_assessment_instance_question');
demand.addQuery("source_id" , current.sys_id);
demand.query();
if(demand.next()) {
template.print (demand.category.getDisplayValue());
}
})(current, template, email, email_action, event)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 10:59 AM
Hi @Sandeep Rajput I tried your script but it did not work. Thanks.