To pull related lists related list in notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-10-2023 08:52 PM
Hi Community,
I want to pull related list's related list in the notification. Notification is on kb_knowledge table.
I have kb_knowledge_base table record, under that u_kb_template_business_impact_assessment_template table records are there.
Under u_kb_template_business_impact_assessment_template this table record, affected products i.e. m2m_kb_ci table records are there.
I want to pull affected products records in my notification which is on kb_knowledge table.
How can i do it.
I have written one email script but its not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-10-2023 10:02 PM
if you have reference field in related table which points to main table, you can fetch the information
Do this
1) notification is on kb_knowledge, so you know the knowledge base associated to this KB
2) get that KB base and query u_kb_template_business_impact_assessment_template with this as parent, fetch all records
3) then query m2m_kb_ci with all the records you received in step 2 and iterate and print
please start from your side
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-16-2023 11:04 PM
Hi,
I am able to pull affected products in my notification.
Here is my script:
var gr = new GlideRecord("m2m_kb_ci");
gr.addQuery("kb_knowledge", current.sys_id);
gr.query();
while (gr.next()) {
template.print(gr.getDisplayValue('cmdb_ci'));
}
I just want comma separated values in the affected products. Currently its printing abcxyz, i want it to be abc,xyz. I tried splitting it but its not working.