Scheduled job restricting notifications for specific country
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello there,
Is it possible to restrict the notifications for users depends on the country?
COUNTRIES:
SOURCE CODE:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
You can extend below logic
If this helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 2 hours ago
Hi @RenzVillanH
You need add some like:
var restrictedCountries = [
'Spain', 'Portugal', 'France', 'Italy', 'Greece',
'Slovenia', 'Croatia', 'Serbia', 'NorthMacedonia', 'Turkey', 'Andorra', 'Israel'
];
var userCountry = userGR.getValue('country'); // country field name
//check the list of country
if (userCountry && restrictedCountries.indexOf(userCountry) > -1) {
continue;
important: The country value needs to be in the sys_user table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
how is the recipient set?
Is it directly at notification level in Who Will Receive tab?
Share notification configuration screenshots.
Users from above countries don't want your Reminder email or they don't want any Notification from instance?
💡 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 || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader