- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 05:37 AM
Hi Community,
I have a scheduled job that syncs user data from ServiceNow to Greenhouse via their API. Once the job completes, I want to trigger a notification indicating whether the sync was successful or failed.
I'm using a custom event like this in my script:
Since I passed null as the GlideRecord, the event is not tied to any specific table. However, when setting up the notification in System Notification > Email > Notifications, the Table field is mandatory.
My Questions:
What table should I select for this kind of generic/global notification?
Is selecting the Global table the best practice in this case?
Are there any potential issues I should be aware of when triggering events like this without a record?
Appreciate any guidance or best practices!
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2025 08:09 AM
Would you mind closing your question by marking appropriate response as correct?
Members have invested their time and efforts in helping you.
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
04-21-2025 06:10 AM
you can use GlideEmailOutbound API syntax to send email and don't use eventQueue()
something like this
var email = new GlideEmailOutbound();
email.setSubject("Open Tasks Notification");
email.setBody(emailBody);
email.setRecipients(userEmail); // Send to the assigned user's email
email.save();
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
04-21-2025 06:24 AM - edited 04-21-2025 06:24 AM
@Ankur Bawiskar
Are you please able understand my use case??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 06:27 AM
I am just saying from wherever you are checking API failure don't use event, notification
You can simply use that GlideEmailOutbound API and send email and you need not create event on some table, notification on some table
Please share how are you checking API failure and the script from scheduled job
something like this
if (API failure) {
var email = new GlideEmailOutbound();
email.setSubject("API Failed");
email.setBody('Your email body html or plain text');
email.setRecipients(userEmail); // send to some static email
email.save();
}
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
04-21-2025 09:18 PM
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