Custom subflow to Fire Event

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
Trying to create a subflow that accepts a group name, Event Name and Record.
The Event Name input is a string.
But the "Fire Event" reports Event name is blank or similar.
If you hard code the event name it works fine. But that makes a subflow kind of pointless.
I have seen articles say you need to make the input a reference filed to the "sysevent_register" table. But this isn't an option for me? (This is a scoped application).
Has anyone made this work?
Thanks...Gary

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Yes, hopfully I can make the Event Name Dynamic. So I can make the subflow reusuable within other flows.
The flow created an event for every member of a group. The event then sends a notification. These groups don't have group emails.
See attached screen shot of the Fire Event, this is currently hard coded to an event.
Thanks...Gary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you can pass event name and then in Action query event table and get the GlideRecord object.
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
3 weeks ago
You are using wrong approach to use the group member table in event. Ideally it should be the record for which you triggered the notification. Like Incident, tasks etc.
If you want to send the notification to group members you can use the Include members checkbox available on the group record.
Include members | Check box that controls whether the group members receive individual emails when someone sends an email to the Group Email address. The only exception to this functionality is for approval notifications, whereby all members of a group receive an approval notification, regardless of the Include members selection. See Receive notifications for more information. |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Yes that is true, but the customer only wants to send to the group when a data condition is met. But yes that would work if I created multiple notifications.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Thanks everyone, I decided in the end to create a Script Action to respond to an event.
This works for what the customer wants to do. So I send an event from the flow and the script action sents the event. Which in turn sends the email.
var groupName = event.parm1;
var eventName = event.parm2;
var getUsers = new GlideRecord('sys_user_grmember');
getUsers.addEncodedQuery('user.active=true^group.name=' + groupName);
getUsers.query(); //Execute the query
while (getUsers.next()) {
try {
gs.eventQueue(eventName, current, getUsers.user.email, getUsers.user.first_name);
} catch (ex) {
gs.info("ERROR: " + ex.message);
}
}