Save an update set as a local XML file
Administrators can export an update set as an XML file to save a specific version of an application or set of changes.
About this task
- The two instances do not have network connectivity so you cannot retrieve update sets from the remote instance nor create a data source to pull, or import, data directly from the source instance.
- You do not want to provide administrator credentials to the source instance (for example, you do not want to share an administrator password with people outside your company) so you cannot retrieve update sets nor create a data source.
- You want to back up important customizations locally.
- Export to XML on the Update Set [sys_update_set] table.
- Export to XML on the Retrieved Update Set [sys_remote_update_set] table.
- Import Update Set from XML on the Retrieved Update Set [sys_remote_update_set] table.
The Export to XML UI Action on Update Set [sys_update_set] table calls a processor called UnloadRetrievedUpdateSet, which transforms a local update set into a retrieved update set, exports the retrieved update set with its related list, and then deletes the temporary update set, if necessary.
Both Export to XML UI actions depend on the script include ExportWithRelatedLists, which exports a record and manually defined related lists to a single XML file.
- Navigate to System Update Sets and click either Local Update Sets or Retrieved Update Sets.
- Select an update set that is in the Complete state.
- On the Update Set form, click the Export to XML Related Link.
- Save the XML file.
An XML file is created. When the file is uploaded to another instance, it appears as a retrieved update set regardless of whether it is local or retrieved on the instance where it is created.
Load customizations from a single XML file
Administrators can load an update set XML file to apply a specific version of an application or set of changes.
- Elevate privileges to the security_admin role.
- Navigate to .
- Click the link Import Update Set from XML.
- Click Choose File and select an XML file.
- Click Upload.
The customization is now available as a retrieved update set with state Loaded.
- Follow standard procedure to commit the update set.
What does Back Out update set means and how to do backout of an update set?Lets say you have done some customization and captured in update set. But now you dont want those customization's in ServiceNow instance.
So, to remove those customization's or development from ServiceNow instance, you can do backout. You can backout the update set those are completed.
After the completed update set backout successfully, then all customizations will get removed and the update set will also get removed from the update set list.
Below are steps to Backout the Update set in ServiceNow:
- Login as Administrator
- Type Update Set in left side filter navigator.
- Click on Local Update Sets
- Open the update set you want to do backout (Note: If your update set is not marked as complete, then first mark it complete)
- The update set which is in complete state, the backout button will get displayed on the right-side top.
- Click on Backout button.
- Pop up appears, read the message and click on Ok Button.
After the backout has be done, validate and verify the customization's you want to remove. It should be removed and not be available in the ServiceNow instance.
What does update set retrieve means and how to retrieve the update set?The most important functionality is to retrieve the update set in ServiceNow. Means through this functionality you can import the update set in the required instance.
For example, you want to transfer or move update set from development instance to Test instance then, In ServiceNow Test Instance you will use this retrieve update set functionality to import the update sets which was exported from the ServiceNow development instance.
Below are the steps to retrieve the update set in ServiceNow:
- Login as Administrator
- Type Update Set in left side filter navigator.
- Click on Retrieved Update Sets, In Related link below you will find link Import Update Set from XML. This link is used to import the update set. Click on this link and choose the file (update set you want to import).
- Click on upload. Once it gets upload it will get displayed on Retrieve Update Set List.
- Click and open the retrieved update set. You will find Preview Update Set button at the top.
What does update set to commit means and how to commit the update set?Following above steps. if you want to move the customization or development activity in the Current ServiceNow instance then you have to commit the imported update sets.
Below are the steps for the same
- Click on Preview update set button. (Preview is basically done to check if there is any issue and if there is any issue then that issue has to resolved first)
- Once the preview is successfully done. Commit Update Set button will get appear on the top of right side.
- Now click on Commit update set button. Now the update set got committed to ServiceNow instance. You can also check the update set state for the same and now all the changes you have developed in developer instance moved to Test instance.
Committing an update set is basically applying all the changes to the instance and creating a local copy of the imported update set.
All Theoretical aspects of ServiceNow update set has been given above. To understand that how we can do all those things in ServiceNow instance practically. Please refer below video:
ServiceNow Update Set Practical Demonstration, refer the below video for the same:
I hope this article helps you to understand the ServiceNow update set in details and the video demonstration provides you the complete understanding of update set in ServiceNow. We have lots of other ServiceNow topics tutorial in this website. You can explore the same. If you have any questions you ask us through the below comment box.Thank you!!!
All instances can export an application to an Update Set. This gives you a single file that contains all the configuration contained within an application. This can be useful as a backup or if the Application Repository cannot be used:
- Navigate to the Custom Application  table. Perhaps the easiest way to do this is to type in the Application Navigator filter and press Enter.
You may want to add a new Module to the System Applications menu to give you easier access.
- Choose the Hotel application, and click on Publish to Update Set
- Fill in the Version and Description if desired, and choose Publish.
It is better to add data to the application by making application files rather than relying
Get ServiceNow: Building Powerful Workflows now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from + publishers.
Start your free trial
Ever lose all your update sets on a clone over?
Your hours spent staring at code is valuable! Backup your stuff and rest easy.
ServiceNow Update Sets
Use System Update Sets to add your customizations to an Update Set
An update set is a group of configuration changes that can be moved from one instance to another. This feature allows administrators to group a series of changes into a named set and then move them as a unit to other systems for testing or deployment.
ServiceNow Code Backup (Single XML)
Backup your Update Set to XML
My biggest concern when dealing with multiple clients, is that one client will clone over development without telling me and my code would be lost. Backup your update sets to XML if you have customizations that would be difficult to replace. You can always delete the xml file after the code is promoted to production.
Another good tip is to remove the condition on the UI Action, "Export to XML" on the update set. You can export an update xml anytime then, the update set doesn't need to be Complete to export.
Remember not all customizations are tracked in Update Sets. Below is list of tracked customizations:
Customizations Tracked by Update Sets
Use an implementation or release plan to keep track of your untracked customizations. You can also export single records to xml in certain cases.
Another good idea to add an "Add to Update Set" UI Action. Then you can add any untracked code to an update set without messing around with xml files.
Add to Update Set UI Action
Update servicenow set export
ServiceNow: Exporting Update Sets to the MidServer
This gist includes a script include and background script that can be used to export files from ServiceNow to a connected Midserver in many different formats. I took the code provided here and tweaked it so that I could do what I wanted to do.
- Background Script (For Testing)
Import update sets
BlackBerry AtHocintegration solution is available in the form of a ServiceNow update set. To deploy this integration solution, you must import the update set to a customer's
ServiceNowenvironment. You must import the following two update sets:
- Open the
ServiceNowinstance and log in with your credentials.
- In the
Filternavigator field, type
Retrieved Update Sets. A list of results is displayed.
Retrieved Update Sets.
- On the
Retrieved Update Setsscreen, in the
Related Linkssection, click
Import Update Set from XML.
- On the
Import XMLwindow, click
Choose File. Navigate to the update set and attach it.
You can import only one update set at a time.
Upload. The update set is displayed in the Retrieved Update Sets window in Loaded state.
- On the update set record, click
Preview Update Setto preview the changes that are captured in the update set. During the update, you may get an error because of the conflicts between the files present in updates set and the files which are already present in the ServiceNow.
Preview Update Setoption, you can only preview the update set changes and cannot commit any changes.
- If an error is displayed, during the import of the
SN-IWS_Alert IntegrationUpdateSet.xmlfile, in the
Update Set Preview Problemsection, click
Skip Remote Updatefor oauth_entity_XX. Select
Accept Remote Updatefor all the remaining conflicts.
When you are done, refresh the main browser window for the changes to take effect.
- Repeat steps 5 to 10 to import the
You will also like:
- Assembly line illustration
- Taylormade driving irons
- 3080 power connector
- Bladder sphincter dyssynergia
- 40 caliber automatic handgun
- Phlebotomy practice test nha
- Toyota twin falls
- Ja morant 2k21
- Fake cia badge generator
Have you ever struggled with moving complicated data structures between instances? Do you wonder if it is possible to define custom XML exports? If you are curious about advanced XML exports and its usage, this article is right for you.
ServiceNow offers the export of any item to XML. It is commonly used to move data, which are not tracked in update sets, between instances. This happens quite often as customers commonly have multiple instances. Real data are in the production/test instances and sometimes it is important for the developer to work with relevant data and the whole instance clone procedure is not possible.
Exporting data from one table is quite straightforward, we can configure a filter and export an XML file and then import it. But it gets tricky when we need to export items containing related items. Then we need to configure multiple filters with a correct filter showing items related to the parent record and it will be stored in the multiple XML files.
ServiceNow offers this possibility, but it has to be developed/configured for particular cases. Here are some examples implemented directly by ServiceNow in the platform: exporting update sets with related update actions, projects with project tasks and dependencies or ROTA schedules.
To achieve this you have to create a UI action, which is redirecting the user to the custom Processor. As an example, you can check OOB UI action Export to XML for the table pm_project and related processor ExportProject (System Definition -> Processors). These processors are using OOB Script Include ExportWithRelatedLists.
One of the use cases of this solution is exporting Service Offerings with related Service Commitments and relations between them and I will showcase this solution. There are also other related items to the Service Offering, which are not shown in the script for simplicity.
And here is the code of the custom processor:
The constructor of the ExportWithRelatedLists accepts the table name and Sys id of the parent record. One item has to be specified as a parent, which is then used in the other functions of the same export run. Also, all fields for this record are stored in the XML file.
Function addQuerySet will include records from any table. You just have to specify the table name and encoded query and during the export, this script will include all items from the query. We have prepared this query by GlideRecord with another filter.
Another function that can be used is adding a related list. It is used for exporting tables that are connected to the parent record via a reference field. It has parameter table name and field name of the reference field, by which it is connected to the parent record. In our case, we have m2m table service_offering_commitment which has field service_offering, that is a reference field to service_offering table. API will then automatically insert sys id of the parent record here so it will return all items from service_offering_commitment table, where field service_offering is equal to sys_id of the exported record (parent record from the constructor).
We can also decide if the export should include attachments to the XML. All you need to do is call the function setAttachments with the parameter “true”. Just be aware that attachments are included only for one parent record.
After calling function export records API will write the XML file into an HTTP response and the XML file will be downloaded by the user. The filename will always be a combination of the parent table name and the sys_id.
Then we just have to create a simple UI action for the Service Offering table:
And one line in the code:
action.setRedirectURL(export_service_offering.do?sysparm_sys_id= + current.getUniqueValue());
This script can also be adjusted to accept a list of sys ids. It allows a user to select multiple service offerings directly from the list view via check-boxes. But then one service offering has to be specified as parent items and others have to be included by function addQuerySet. The downside is, that filename can’t be changed and attachments are included only for the parent item.
First, we tried to use export sets, but when we needed to move just particular items, export sets had to be configured each time and also not all fields were included automatically.
This solution takes just a few minutes to set up and then you can export any hierarchy from ServiceNow. It saved us a lot of time moving Service Offering between instances. It is a really useful tool in ServiceNow, which can decrease the amount of manual work during development and testing.
The presented approach could also be used in Project management or Agile plugin for exporting hierarchies. As groups and role assignments are not stored in update sets, this case can also be used. Or even for the exporting of Catalog items with all variables, variable sets, UI policies, and client scripts at once.
Custom XML export API of ServiceNow is not well documented, but it is already used in many places in the platform, so I hope this article will clarify its usage and help you speed up the development process.