Can we run a business rule on XML import?

Bharat23
Kilo Guru

I am migrating knowledge articles (KA) from one SN instance to another and KA numbers have conflicts. I want to to XML import to retain attachments. Not sure if I can use transform maps as XML has data for multiple backend tables (attachments) and mapping them will be too cumbersome hence I was considering an alternate approach. Since XML import works on sys id and we do not have a conflict there, import will be successful but I will end up with duplicate KA numbers. Hence I created a business rule which runs on before insert and sets moves incoming KA number to another field and sets KA number to blank. I was hoping that system will generate a new KA number but it did not work as expected...actually business rule was not even triggered. So I am assuming that business rule is blind to XML import.

Any suggestions?

4 REPLIES 4

Mark Stanger
Giga Sage

You are correct, XML imports don't run business rules.   There's no way around this as far as I know, but you can run a background script after to adjust the numbers.



» How to Add Numbering or IDs to a Set of Existing Records in Service-now


Hi Mark,



I was also thinking about background script and was researching on number


maintenance. Thanks for sharing the article from SN guru, I guess it's


exactly what I was looking for...


Just a follow up question, when I do an xml import it imports create date


field also hence I cannot use these system fields to find the KAs I want to


renumber and KA number is not blank either. I can still use created by and


dot walk to email id and check if it belongs to users migrated from the


other instance but just wanted to check if there is a better way?



Thank you



On Wednesday, May 20, 2015, Mark Stanger <community-no-reply@servicenow.com>


XML export/import migrates the records exactly as they are in the source instance so you'll need to find something on those records in the source instance that identifies the group.   If the email ID does that, I think that's the best way.


Mark...thanks for your help



On Wednesday, May 20, 2015, Mark Stanger <community-no-reply@servicenow.com>