Export Record as XML
export_record_xmlExport any ServiceNow record as unload XML for backup, transfer to another instance, or inclusion in update sets. Uses the .do?UNL endpoint to generate reusable XML.
Instructions
Export a single record from a ServiceNow instance in unload XML format. Uses the /.do?UNL endpoint to generate ServiceNow-native XML that can be imported into another instance or used as a configuration backup.
Common use cases:
Backing up a Script Include, Business Rule, or other configuration record
Exporting a record to transfer it to another instance
Comparing record definitions across instances
Generating XML for inclusion in an update set
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance | No | The ServiceNow instance auth alias to use. This is the alias configured via `now-sdk auth --add` (e.g., "myinstance", "prod", "test"). The user will typically refer to this by name when saying things like "on my myinstance instance". If not provided, falls back to the SN_AUTH_ALIAS environment variable. | |
| table | Yes | The table name of the record to export (e.g., 'sys_script_include', 'sys_script', 'incident', 'sys_ui_page', 'kb_knowledge'). | |
| sys_id | Yes | The sys_id of the record to export. |