How to add to email in the notification using flow custom action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 04:24 AM
Hello Everyone
I have requirement to send a notification to the selected user on the catalog item.
catalog item has variable 'app manager'(type: reference). To this user we need to send a notification.
using custom flow action in the flow, how to do it please suggest.
Below code using in the custom action of the flow for triggering the notification.
(function execute(inputs, outputs) {
// ... code ...
var scItem = new GlideRecord('sc_req_item');
scItem.addQuery('sys_id', inputs.ritm);
scItem.query();
if(scItem.next())
{
var appMgr = scItem.current.variables.getDisplayValue('app_manager_approval');
}
gs.eventQueue('KP.SC.C2C.Power5Installation', gr, current.appMgr.email);
})(inputs, outputs);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 04:28 AM
why custom action required?
You can simply use "Send Email" flow action and set the recipient, subject, body etc?
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
07-24-2025 04:32 AM
Use "Get Catalog variables" action to fetch the variable values and then use send email or trigger event action to trigger the notification in your flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 04:48 AM
@Ankur Bawiskar @Pranesh072
we are fetching data from different record from different table. for this we need to use email script and notification.
we are not able to add notification and email script in send email for this we need to go for the custom action of the flow. where we need to get selected user email id and call the event through gs.eventQueue method
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 04:56 AM
got it
2 ways to handle
1) have notification created on RITM table and then in that have email script etc, then use "Send Notification" flow action and select your Notification
OR
2) use a flow variable to form the complete HTML body and you can use "Set Flow variable" flow logic and then use this flow variable to be set in Body of "Send Email" flow action
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