- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2024 11:51 PM
Hello Experts,
I am looking for something that will send email to some specific users where is there is no Insert/update of records in the list of tables. table , operations, User to notify and Number of days should be accepted dynamically from a property. Email should should contain a table with the list of tables where there is no interaction in last n number of days. Any thoughts on the implementation part?
All kinds of suggestions are welcome.
Thank you in advance!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 04:04 AM
Create notification on 'Global' table.
For Example,
The script is checking records updated in last 15 days. If any record is created or updated in Last 15 days then your GlideRecord will get return true for hasNext().
That means if any activity happen in last 15 days then GlideRecord will return some records else you can send notification.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 12:03 AM
Hello! To achieve the functionality you're describing, you'll likely need to create a scheduled script that checks for insert/update activities in the specified tables.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 12:09 AM
Hi,
You can create two properties.
1. First property will store the comma separated table names that you want to monitor. (name = monitor_inactivity_for_tables)
2. Second property will store the no of days. (name = inactivity_monitor_period_in_days)
3. Create a schedule job that should run daily.
4. Use below script in your scheduled job:
var table_name = gs.getProperty('monitor_inactivity_for_tables'); // store value in property like sys_user,incident,problem
var tablesArr = table_name.split(',');
var days = gs.getProperty('inactivity_monitor_period_in_days');
var unusedTables = [];
for(var i=0; i<tableArr.length;i++){
var tableGr = new GlideRecord(tableArr[i]);
tableGr.addEncodedQuery('sys_updated_onRELATIVEGT@dayofweek@ago@'+days);
tableGr.query();
if(!tableGr.hasNext()){
unusedTables.push(tableArr[i]);
}
}
gs.eventQueue('event_name',tableGr,unusedTables);
I suggested a way to query and find unused tables. You can used event based notification and add recipients directly on email notification as you have fixed list of recipients. Use the event1 parameter values as unused table names in email body.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 01:29 AM
Hi @Anil Lande ,
Thank you for your inputs.. I have a query do I need to create a flow also?
Any thoughts if you can share this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 01:55 AM
No Need to create Flow.
If you want to create flow then you need to create custom action to run above script. Instead create a Schedule Job.
Thanks
Anil Lande