How to Send a Notification to a Catalog Item Variable (sys_user) with "When to Send: Triggered
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Team,
Need help!
There is a notification on table sc_req_item, whose
When to send: Triggered
I want to send this notification email to a variable of this cat item.
Variable (value): Supervisor (supervisor) (Type-Reference (sys_user table)) and First name (first_name) (Type-Reference (sys_user table))
I am unable to do dot walk into this variable of cat item from 'who will receive' > 'Users/Groups in fields' as I want to send this notification to the variable supervisor and first_name.
Please help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
13 hours ago
Hello @TharshneK185996 ,
variables can't be fetched from who will receive,
you can use Send Email Action to include variable :
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12 hours ago
so you want email to be sent to the user selected in that variable
that's not possible with OOTB notification
2 solutions
1) use flow "Send Email" flow action and include the recipient by grabbing the variable using "Get Catalog Variables" flow action
OR
2) create after insert BR on RITM table, create event on RITM table and then create notification on RITM table linked with this event, from BR script use gs.eventQueue('event_name', current, current.variables.supervisor.toString()); and then in notification use "Event parm1 contains recipient" checkbox as true
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Follow these steps to configure the notification since you cannot natively dot-walk to Catalog Item variables in the standard "Who will receive" dropdown, you must fire an event from a Business Rule and pass the Supervisor's sys_id as the event parameter.
1: Register the Event
- Navigate to System Policy > Events > Event Registry.
- Click New.
- Create an event name: sc_req_item.supervisor_email.
- Table: sc_req_item.
- Enter a brief description.
2: Create a Business Rule
- Navigate to System Definition > Business Rules and click New.
- Name: Fire Event for Supervisor Notification
- Table: Requested Item (sc_req_item)
- When to display / Before-After: After / Insert (or Update, depending on your conditions)
(function executeRule(current, previous /*null when async*/) {
var supervisorSysId = current.variables.supervisor.toString(); // Replace 'supervisor' with the actual name of your catalog variable
if (supervisorSysId) {
gs.eventQueue('sc_req_item.supervisor_email', current, supervisorSysId, '');
}
})(current, previous);
3: Configure the Email Notification
- Navigate to System Notification > Email > Notifications.
- Open or create your notification for the sc_req_item table.
- Under When to send, set Send when to Event is fired.
- Select the sc_req_item.supervisor_email event you created.
- In the Who will receive tab, check the box for Event parm1 contains recipient.
- In the What it will contain tab, you can pull variable data using the mail script token ${mail_script:your_email_script_name} or directly reference standard form fields.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti