- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2024 04:10 AM
Hi Experts
Good day!
I am new to ServiceNow. I got one requirement. In existing I have a transfer map data load on "u_swim" table through schedule imports daily at 8am.
here my requirement is : I have to send a notification to "trai" team daily whenever the records got inserted and updated in "u_swimlane" table with the number count of how many records got inserted and how many records got updated and how many records got rejected in a stagging table while data got loaded into target table I.e "u_swimalane"
How can I achieve this I have seen some video's and created a event in event registry [name: sfx_event ] and also in notifications I have created a new notification [name:SFX Data load] and selected event is fired and and picked up the event name and I checked the insert and update check box.
I am not aware about the schedule job script and in notification script
Could you please help me with the scripts in scheduled job and notification
Any help will be appreciated
PFA
Thanks
Aakhil
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2024 07:08 AM
you should have notification on this table (sys_import_set_run) and it will run when the transform is complete.
Create a group with the email to whom it needs to be sent
you can then send the list of inserts, updates etc
Include the group in Who will receive section
Then include the body like this
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-26-2024 07:08 AM
you should have notification on this table (sys_import_set_run) and it will run when the transform is complete.
Create a group with the email to whom it needs to be sent
you can then send the list of inserts, updates etc
Include the group in Who will receive section
Then include the body like this
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-28-2024 08:29 PM
Thanks for your help @Ankur Bawiskar
Thanks a lot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2024 05:06 AM
Hi @Ankur Bawiskar
Thanks for your help I have created a notification and event on (sys_import_set_run) table.
Notification : SFX Data load (Pic1)
Event : sfx_dataload (pic2)
But here I need to call the notification & event in my schedule job script. But existing I already have some script can you please help me with the scheduled job script how can I modify/add (pic3)
schedule job existing script :
var gr = new GlideRecord('sys_data_source');
var dataID = gs.getProperty('swimlane1.sfx.material.id.data.source');
if(gr.get(dataID)){
var gdt = new GlideDateTime().getLocalDate().getByFormat("yyyy-MM-dd").toString();
var arrD = gdt.split('-');
var fileDate = arrD[0]+arrD[1]+arrD[2];
var path = gr.file_path;
var x = path.indexOf('CustMat');
var newPath = path.substring(0,x);
newPath = newPath +'CustMat_'+fileDate+'.csv';
gs.log('SL1 material ID SFX path : ' + newPath,'SFX_LOAD');
gr.file_path =path+newPath;
gr.update();
gs.log("****LOK file updated",'SFX_LOAD');
}
gs.log('****LOK schedule started','SFX_LOAD');
Thanks
Arsshad