Company Data Normalization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2022 09:36 PM
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.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0784201
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();
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 10:42 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 11:43 AM
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.