How to identify if a record is created via a robust transform map

Roshini
Giga Guru

We have an airWatch ServiceNow integration with service graph connector plugin approach. It has a robust transform map and primary key for handheld devices are via  IRE of cmdb. Can I know how we can find out if the data/record is created for the first time via this intgeration? Based on that, if it's created for the first time i need to make a field as personal. Can Someone help to achieve this.

5 REPLIES 5

Kristen Ankeny
Kilo Sage

When records are created via RTE, there is a corresponding record entered into sys_object_source to tie the RTE to the target records. You could leverage this for your trigger. Or, you could go to the transform definition itself because there are now options to run before and after scripts there. 

For onbefore script I tried this way.

 for (var i = 0; i < input.length; i++) {
        // if a record is inserted set policy to personal'
        if (input[i].status == 'INSERTED')
            temp[i].policy = 'Personal';

    }
Will this be fine..any suggestions

Kristen Ankeny
Kilo Sage

This site shows what is available for the script fields: https://docs.servicenow.com/bundle/tokyo-platform-administration/page/administer/import-sets/task/cr...

 

I would test to see if the if(action == 'insert') is a valid option in the script here, as that is the simplest way. You shouldn't have to for loop it, it is going to run the script for each row oob from what I'm seeing.

Am getting bellow error when using action == 'insert'

Before script unable to process records with error message: "action" is not defined.