Export directly from a URL

You may want to export data from the URL if you need to dynamically export data from a script or web service.

About this task

You must be familiar with the ServiceNow table and column names to export data directly from the URL. See URL schema for more information about navigating to forms and lists.

Query parameters are available for you to use in the instance URL so you can display a specific list of records in a specific order:
URL Parameter URL Syntax Description
sysparm_query sysparm_query=[column name][operator][value]

Displays a list of records that match the query. For example:

https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1

sysparm_orderby sysparm_orderby=[column name]

Sorts a list of records by the column name provided. For example:

https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1&sysparm_orderby=assigned_to

You can sort by only one column using sysparm_orderby. To sort by multiple columns, use sysparm_query=ORDERBY[column name]^ORDERBY[column name]. For example: sysparm_query=ORDERBYassigned_to^ORDERBYpriority.

To export data directly from the URL, create a URL containing the following parts:

Procedure

  1. Specify the instance URL. For example, https://<instance name>.service-now.com/.
  2. Specify the table form or list to export. For example, incident_list.do.
  3. Specify the export format processor to use for the export. For example, ?CSV.
  4. (Optional) Specify a query and sort order with URL parameters. For example, &sysparm_query=sys_id%3E%3Db4aedb520a0a0b1001af10e278657d27.

    The final URL should look like one of these sample URLs:

    URL Description
    https://<instance name>.service-now.com/incident_list.do?CSV Export all incidents to a comma-separated value text file.
    https://<instance name>.service-now.com/incident_list.do?CSV&sysparm_query=sys_id%3E%3Db4aedb520a0a0b1001af10e278657d27 Export a particular incident to a comma-separated value text file.
    https://<instance name>.service-now.com/incident_list.do?CSV&sysparm_orderby=sys_id Export all incidents to a comma-separated value text file and sort the list by sys_id.
    Export from URL
    Note: ServiceNow enforces basic authentication for direct URL access. The data extracted from the URL contains only the fields to which the currently authenticated user has read access.