Service-now.com makes extensive use of the XML format for storing and transporting system updates and changes. Update sets, System Import Sets, and certain export methods all make use of XML files in one way or another. One feature that a lot of people don’t know about until somebody shows them is the ability to export and import XML files in a Service-now instance. A manual XML import/export can be extremely helpful in the right circumstances and is something that every Service-now consultant or administrator should have in their tool belt. In this post, I’ll explain how simple it is to transport system changes from one Service-now instance to another with a few clicks.
First of all, I don’t recommend using this method as a full-time replacement for update sets or import sets between instances. Those methods are much better for bulk changes and much less prone to user error when configured and used correctly. This method is completely manual, but it is really nice to know about if you’ve got something that you need to do one time – maybe something got left out of an update set or you need to pull a record from the Service-now demo instance.
XML Export (Single Record from a form)
If you need to export a single record the easiest way to do it is simply to open up the record and right-click the form header as shown below. The export will ask you to save an XML file which can be imported in another Service-now instance.
XML Export (Multiple Records or Single Record from a list)
You can also export to XML from any full table list (it doesn’t work from related lists on a form). Exporting from a list allows you to filter down to multiple records (or even a single record) that you want to export. Anything that shows in the filtered list will be part of the export. The export option is accessed by right-clicking the list header as shown below.
Once you have an XML export using one of the methods described above, you can import that XML file into any Service-now instance by right-clicking any full list header (it doesn’t work from related lists on a form) and selecting the ‘Import XML’ option. Since your XML file contains all of the details about the record(s) included you don’t have to worry about where you initiate the import from. For example, I could import a business rule export using the context menu from a list of users. The system knows from the details of the XML file where the records really need to go. It also doesn’t care if the import contains one or multiple records. The process is the same for both. Any record(s) that don’t exist in the destination instance will be created and any that already exist will be updated – AS LONG AS THE SYS_ID VALUES MATCH.