How to get values from a event parameters and use them in a notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 06:41 AM
I'm trying to setup a notification for when a certain catalogue item is completed. The catalogue item contains a list of business application that a user chooses to update. I've created a business rule that triggers the event:
I'm trying to use the following code to find any business applications that had been updated at the same time:
However, what I find is that nothing is being returned in the logs even though a business application has been updated through the catalogue item.
My email notification is using the Business Application table:
What I'm finding is that the ${u_business_owner} and ${department} fields are not getting updated:
If somebody can advise what I need to do to retrieve the values, that would be great.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 05:06 AM
Thanks @Ankur Bawiskar
For one of my variables, it's a list of collector. This contains a list of selected Business Applications. There are two things that I'm wanting to extract:
1. The business owner of each business application
2. How do I extract the list of each business application assigned to the Business Owner?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 05:14 AM
then query that table which is being referred by that list collector
iterate and print the owner
something like this, please enhance
var val = current.variables.listCollectorVariableName;
var gr = new GlideRecord("cmdb_ci_business_app");
gr.addQuery("sys_id", "IN", val.toString());
gr.query();
while (gr.next()) {
template.print('Owner ' + gr.owner.getDisplayValue());
// then query again with same table with this owner and print the Business app name
var gr1 = new GlideRecord("cmdb_ci_business_app");
gr1.addQuery("owner", "IN", gr.owner);
gr1.query();
while (gr1.next()) {
template.print('Business app ' + gr.getDisplayValue());
}
}
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
01-13-2025 06:31 AM
Hi @Ankur Bawiskar I've got the business applications to display in list view by using the following:
However, from the list of business applications, each one will have a different business owner. So I'm wanting an email to be generated to each business owner and show only the selected Business Applications that they are the owner of. Do you know what I need to do to achieve that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 06:56 AM
I believe I have provided answer to your original question.
If my response helped please mark it correct as well 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
01-13-2025 07:21 AM
Hope you are doing good.
Did my reply answer your question?
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