Servicenow export update set

Servicenow export update set DEFAULT

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

Typically you create an XML file of an update set when one of the following conditions apply:
  • 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.
The ability to export and import customizations as an XML file is provided by the following UI Actions:
  • 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.


  1. Navigate to System Update Sets and click either Local Update Sets or Retrieved Update Sets.
  2. Select an update set that is in the Complete state.
  3. On the Update Set form, click the Export to XML Related Link.
  4. 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.

  1. Elevate privileges to the security_admin role.
  2. Navigate to .
  3. Click the link Import Update Set from XML.
  4. Click Choose File and select an XML file.
  5. Click Upload.

    The customization is now available as a retrieved update set with state Loaded.

  6. Follow standard procedure to commit the update set.
    Retrieved update set

What does Back Out update set means and how to do backout of an update set?

Let&#;s say you have done some customization and captured in update set. But now you don&#;t 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!!!

  1. 2004 subaru outback weight
  2. Bible verses posters
  3. 13 fishing rods
  4. Accent wall planks
  5. Sharp vz 3500

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:

  1. 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.

  1. Choose the Hotel application, and click on Publish to Update Set
  2. 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.

Tracked Customizations

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.


varExportToMidserver=Class.create();ExportToMidserver.prototype={initialize: function(){//// Set up the Packages references//;;;;;;////Set up the parameters//this.domain=probe.getParameter("httpDomain");this.port=probe.getParameter("httpDomainPort");this.protocol=probe.getParameter("httpProtocol");//http/httpsthis.relativeUrl=probe.getParameter("relativeUrl");this.verbose=probe.getParameter("verbose");this.filename=probe.getParameter("filename");"directory");this.username=probe.getParameter("username");this.password=probe.getParameter("password");//// run it automatically////return this.execute();},execute: function(){//// Set up the HTTP Connection. We will use the PDF web service built into SN//varclient=newthis.HttpClient();varauthScope=newthis.AuthScope(this.domain,this.port,null);varcredentials=newthis.UsernamePasswordCredentials(this.username,this.password);client.getState().setCredentials(authScope,credentials);varurl=this.protocol+"://"+this.domain+":"+this.port+"/"+this.relativeUrl;this.debug("URL: "+url);varget=newthis.GetMethod(url);get.setDoAuthentication(true);//// Now that we have the HTTP client set up, we are going to submit the request// to ServiceNow//varstatus=client.executeMethod(get);this.debug("GET Status: "+status);if(status==""){//// We are going to write the HTTP Response to a file//this.debug("Attempted to save the file to filname: "+this.filename);varf=newthis.File(;varf=newthis.File('/'+this.filename);varinputStream=get.getResponseBodyAsStream();varout=newthis.FileOutputStream(f);,);while((>0){this.debug("Writing to the file…with buffer size of "+len);out.write(buf,0,len);}out.close();inputStream.close();varresult="Done creating "+this.filename;this.debug(result);}else{varresult="Invalid HTTP Response. Exiting Early.";this.debug(result);}returnresult;},debug: function(m){if(this.verbose=="true"){ms.log(m);}},type: ExportToMidserver};
  • Background Script (For Testing)
varusername="";// Enter username of an adminvarpassword="";// Enter password of an adminvarupdates=getUpdateSetIds();createXmlForUpdateSets(updates);functiongetUpdateSetIds(){varids=[];varus=newGlideRecord('sys_update_set');us.addEncodedQuery('state=in progress^sys_created_by!=system^ORsys_created_by=NULL');us.query();while({ids.push(us.sys_id+'');}returnids;}functioncreateXmlForUpdateSets(ids){for(vari=0;i<ids.length;i++){varupdate_set=newGlideRecord('sys_update_set');update_set.get(ids[i]);varretrievedUpdateSet=newGlideRecord('sys_remote_update_set');retrievedUpdateSet.initialize();retrievedUpdateSet.description=update_set.description+'';'';retrievedUpdateSet.release_date=update_set.release_date+'';retrievedUpdateSet.remote_sys_id=update_set.sys_id+'';retrievedUpdateSet.application=update_set.application+'';varscopeGr=newGlideRecord('sys_scope');scopeGr.get(update_set.application);if(scopeGr.isValid()){;retrievedUpdateSet.application_scope=scopeGr.scope;retrievedUpdateSet.application_version=scopeGr.version;}retrievedUpdateSet.state="loaded";varexp_id=retrievedUpdateSet.insert();varupdate=newGlideRecord('sys_update_xml');update.addQuery('update_set',update_set.sys_id);update.query();while({update.remote_update_set=retrievedUpdateSet.sys_id+'';update.update_set='';update.insert();}varfile_name='';if(''=='Default'){' - ''';}else{'';}_exportToMid(exp_id,file_name);}}function_exportToMid(sys_id,name){varjspr=newJavascriptProbe('cfdlsnmid01');jspr.setName('ExportToMidserver');//Any descriptive name will dojspr.setJavascript('var exp = new ExportToMidserver(); res = exp.execute();');jspr.addParameter("httpDomain","");jspr.addParameter("httpDomainPort","");jspr.addParameter("httpProtocol","https");jspr.addParameter("relativeUrl",""+sys_id+"&sysparm_delete_when_done=true");jspr.addParameter("verbose","true");jspr.addParameter("filename",name+".xml");jspr.addParameter("directory","/apps/servicenow/files/"+_getDate());jspr.addParameter("username",username);jspr.addParameter("password",password);jspr.create();}function_getDate(){varcurrentTime=newDate();varmonth=("0"+(currentTime.getMonth()+1)).slice(-2);varday=("0"+currentTime.getDate()).slice(-2);varyear=currentTime.getFullYear();vartoday=year+'_'+month+'_'+day;returntoday;}
26. ServiceNow - Update Set

Import update sets

The entire 


BlackBerry AtHoc

 integration 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 


 environment. You must import the following two update sets:
  • SN-IWS_Alert IntegrationUpdateSet

  1. Open the 


     instance and log in with your credentials.
  2. In the 


     navigator field, type 

    Retrieved Update Sets

    . A list of results is displayed.
  3. Click 

    Retrieved Update Sets

  4. On the 

    Retrieved Update Sets

     screen, in the 

    Related Links

     section, click 

    Import Update Set from XML

  5. On the 

    Import XML

     window, click 

    Choose File

    . Navigate to the update set and attach it.

    You can import only one update set at a time.

  6. Click 


    . The update set is displayed in the Retrieved Update Sets window in Loaded state.
  7. On the update set record, click 

    Preview Update Set

     to 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.
  8. Click 



    Preview Update Set

     option, you can only preview the update set changes and cannot commit any changes.
  9. If an error is displayed, during the import of the 

    SN-IWS_Alert IntegrationUpdateSet.xml

     file,  in the 

    Update Set Preview Problem

     section, click 

    Skip Remote Update

     for oauth_entity_XX. Select 

    Accept Remote Update

     for all the remaining conflicts.
  10. When you are done, refresh the main browser window for the changes to take effect.

  11. Repeat steps 5 to 10 to import the 



You will also like:

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.

This is what a custom processor looks like. Name is not important, but Type is a script, so you can write your own javascript code. You have to specify a path by which it will be called from a UI Action.

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(&#;; + 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. 


4815 4816 4817 4818 4819