- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2023 09:34 AM
I'm not sure if this is possible, but I'm trying to dotwalk within a Notification to include a field from another table. The table in which the notification resides is the Demand [dmn_demand] table. The field which I'm trying to include in the notification is a field from the Stakeholder Register [dmn_stakeholder_register] table and this field is a custom field "u_level_team" that references the Group [sys_user_group] table.
How is this achieved if possible.
Thanks,
AJ
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2023 10:09 AM
Hi @TStark ,
you can add info in your email using Email script
Steps:
1)Create a email script
fetch "u_level_team" by gliding m2m table i.e "dmn_m2m_demand_stakeholder"
var demand = new GlideRecord("dmn_m2m_demand_stakeholder");
demand.addQuery("demand", current.sys_id)
demand.query() //if its for one record
if(demand.next()){
template.print(demand.stakeholder.u_level_team.getDisplayValue());
}
2)Call this email script in your notification
like: ${mail_script:name of your email script}
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2023 10:09 AM
Hi @TStark ,
you can add info in your email using Email script
Steps:
1)Create a email script
fetch "u_level_team" by gliding m2m table i.e "dmn_m2m_demand_stakeholder"
var demand = new GlideRecord("dmn_m2m_demand_stakeholder");
demand.addQuery("demand", current.sys_id)
demand.query() //if its for one record
if(demand.next()){
template.print(demand.stakeholder.u_level_team.getDisplayValue());
}
2)Call this email script in your notification
like: ${mail_script:name of your email script}
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2023 12:22 PM
Hi Hemanth,
I tried the email script you've provided and I didn't get anything when I previewed the email notification. I did a test to see if any other field would work. I used the "number" field instead of the custom reference field in question: "u_level_team" and in the notification preview it returned the Stakeholder's number (STAK000...). Below is my mail script and a screenshot of the notification calling the mail script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2023 12:31 PM
Hold that thought. Before I say your script doesn't work just by doing a preview, let me trigger the notification to test the mail script. I'll be back.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2023 09:22 PM
Hi @TStark ,
Did it work?? check you have "u_level_team" value in the preview record STAK000..
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025