- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 06:21 PM - edited 01-21-2024 04:43 AM
How to trigger an event via workflow runscript or create event? Can i trigger an event via workflow using gs.eventQueue by creating event in registry.(do we need notification)?
please let me know if notification has to be created as well. or the event can be triggered directly using script. Thanks
var gr = new GlideRecord("sysapproval_approver"); gr.addQuery("sysapproval", current.sys_id); gr.query(); while (gr.next()) { gs.eventQueue('EVENT_NAME', gr, gr.approver.toString()); }
Also can i trigger event using create event in workflow core activities without creating notification(what is event in servicenow and why it is used). Thanks for the help*!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 05:03 AM
Hi @servicenow14710 ,
Notification can be triggered via multiple ways. But if u wish to trigger it via event then yes creating notification seperately is mandatory. If u notice while creating notification the trigger conditions are Record Created/Updated or when event is fired.
So if u wish to trigger a notification via event then u need to have a notification created with when to run condition set as event fired & select ur event name in that.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 05:14 AM
Hello @servicenow14710
Absolutely, notifications in ServiceNow can be activated through various methods. When opting to trigger a notification via an event, it's essential to create a separate notification. What's crucial to observe during the notification setup is the trigger conditions. These conditions typically revolve around events like Record Created/Updated or when a specific event is fired.
Therefore, to seamlessly connect the event and notification, it's necessary to craft a notification where the "when to run" condition aligns with the event being fired. Within the notification configuration, be sure to select the relevant event name, solidifying the link between the event and the notification.
Feel free to reach out if you have further inquiries!
Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Aniket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 07:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 04:39 AM - edited 01-21-2024 04:43 AM
@Community Alums : Hi sandeep, not trigger email my question is to send email is it enough to create an event or needed notification too(what is event in servicenow and why it is used)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 05:03 AM
Hi @servicenow14710 ,
Notification can be triggered via multiple ways. But if u wish to trigger it via event then yes creating notification seperately is mandatory. If u notice while creating notification the trigger conditions are Record Created/Updated or when event is fired.
So if u wish to trigger a notification via event then u need to have a notification created with when to run condition set as event fired & select ur event name in that.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 05:09 AM
@Danish Bhairag2 :Thanks for your reply , this answers my concern as i am creating event via workflow needed to know whether notification is required or not if we select create event or run script(for event creation). Thanks!