Import Records from XML
import_records_xmlImport ServiceNow unload XML to create or update records on a target table.
Instructions
Import XML records into a ServiceNow instance via the sys_upload.do processor. Accepts ServiceNow unload XML format (the output of export_record_xml or update set XML exports).
IMPORTANT: This is a mutative operation that creates or updates records on the instance. Always verify the XML content and target table before importing. Use this for restoring configurations, migrating records between instances, or applying exported record definitions.
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. | |
| xml_content | Yes | The XML content to import in ServiceNow unload format. This is typically the output from export_record_xml or an XML update set export. | |
| target_table | Yes | The target table to import the records into (e.g., 'sys_script_include', 'sys_script', 'incident'). Must match the table in the XML content. |