Company Data Normalization

Sunny45
Kilo Guru

Team,

I am working on Normalization Data through the Guided setup. While running Update Reference qualifier, I noticed ~2k+ records need to modify manually. (Need to add condition Normalized = True to the Reference Qualifier  as shown below) I also saw SNOW documentation about it.  Is it possible to add this condition via script for this 2043 records? Manually adding this condition will take for ever.

If possible please help me out.  

 

Sunny45_0-1666844836929.png

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0784201

 

Sunny45_1-1666845356820.png

I tried it on a record "cmdb_ci_acc" as below but doesn't seems to be working. 

 

var rec = new GlideRecord('sys_dictionary');

rec.addEncodedQuery('reference.labelSTARTSWITHcompany^name=cmdb_ci_acc');

rec.query();

while(rec.next()){

    if(rec.element == 'customer'){

      rec.setValue('reference_qual_condition' , 'customer=true^canonical=true^EQ' );

      rec.update();

    }

    else if(rec.element == 'vendor'){

      rec.setValue('reference_qual_condition' , 'vendor=true^canonical=true^EQ' );

      rec.update();

    } 

}

 

2 REPLIES 2

Rajiv Handa
ServiceNow Employee
ServiceNow Employee

You can refer to the following official KB article to do this easily. Basically, you should target the base tables first as the field is inherited to the child tables.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0784201

The best way to accomplish this is just sort the list by created (oldest first) then update the first 20 or so records. Everything else should be complete after that.