- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2023 06:28 AM
I have a notification on the Demand table. How can I include the value of a field from the Requirement [dmn_requirement] table? Dot walking doesn't work as the two tables aren't directly related.
Thanks,
AJ
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2023 02:42 PM - edited ‎10-25-2023 02:43 PM
@TStark , try the below code
(function runMailScript(current, template, email, email_action, event) {
var demand = new GlideRecord("dmn_requirement");
demand.addQuery("demand", current.sys_id)
demand.query() //if its for one record
if(demand.next()){
template.print('Demand Requirement' + demand.short_description.getDisplayValue());
}
})(current, template, email, email_action, event);
Please Mark my answer Helpful & Accepted if I have answered your question.
Thanks,
Alka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2023 06:35 AM
if the 2 tables are not directly related, you need to know how they are linked and then use email script and print the fields from another table
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2023 09:02 AM - edited ‎10-25-2023 09:12 AM
Hi @Ankur Bawiskar I appreciate your response. I'm aware that an email script will be needed, but the problem is I don't know what that email script will look like when trying to associate these two tables (dmn_demand and dmn_requirement) for the notification.
Thanks,
AJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2023 12:30 PM
Hello @TStark ,
How two tables (dmn_demand and dmn_requirement) are related with each other and which all fields of dmn_requirement table you want on the notification, share the backend name list. I will help you with the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2023 02:30 PM
Hi @Alka_Chaudhary,
I would like to include the value from the short_description field of the dmn_requirement table in a notification which I've created for the dmn_demand table. Below is my mail script.
(function runMailScript(current, template, email, email_action, event) {
var demand = new GlideRecord("dmn_requirement");
demand.addQuery("demand", current.sys_id)
demand.query() //if its for one record
if(demand.next()){
template.print(short_description.getDisplayValue());
}
})(current, template, email, email_action, event);