Need to identify which all fields got updated post transform

SNOW46
Tera Contributor

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

6 REPLIES 6

saini
Tera Expert

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.

saini
Tera Expert

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);

SNOW46
Tera Contributor

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

SNOW46
Tera Contributor

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