Need to identify which all fields got updated post transform
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 11:36 AM
Hello All,
We are receiving a weekly report for all active users records from AD Team. I am trying to import that sheet in SNOW via Import Set and perform the mapping of the fields making User ID unique or coalesce and performing the transform for all those records in the sys_user table.
Here I need to identify post the transform for all the records which all fields got updated? I can see the updates count as 1 for each record but can't able to figure out which all fields got updated.
Can someone help me out on this acivity? I need to prepare a demo fr our management on this.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 04:17 PM
Hi,
You can write a transform script for that, I have attached the link to the scripting if you need help
https://docs.servicenow.com/bundle/sandiego-platform-administration/page/script/server-scripting/reference/r_MapWithTransformationEventScripts.html
I think you can write onBefore transform script and you can check the action field for insert or update and then log the fields out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 04:36 PM
you need to write the transform script and here is the link for the transform script
https://docs.servicenow.com/bundle/sandiego-platform-administration/page/script/server-scripting/reference/r_MapWithTransformationEventScripts.html
The code i am writing is rough code and you need to refine it, I think you can write onAfter script
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if(action == 'update')// check if its update
{
if(source.field1 != target.field1)// so this field1 is updated and u can check for other fields too
{
//here you can log the field1
}
}
})(source, map, log, target);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2022 03:14 AM
Hello Saini,
Great, if you can share with me the exact script which needs to be customized here then it will be very much helpful for me to achieve this requriement.
Please share me the full script to be customized.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2022 07:59 AM
Hello Saini,
Can you please help me with the detailed script to achieve this?
I have got stuck here, need your help as I need to showcase a demo for this.
Thanks