Export directly from a URL

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:7分
  • Dynamically export data from a script or web service by building a URL query.

    始める前に

    Role required: None

    注:
    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.

    このタスクについて

    You can use URL queries to generate filtered lists of records programmatically before exporting them. URL queries are useful for scripts that generate a list of records or when no user can manually add the filter from the UI.

    You must be familiar with the ServiceNow table and column names to export data directly from the URL. See Navigate to a record or a module using a URL.

    You can control whether to export the display value or raw value of fields and the field label or field name for headers using query parameters or system properties. Query parameters, if present, override system properties.

    手順

    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.
      You can specify CSV, XLS, JSON, XLSX, or XML. For example:
      ?CSV
      注:
      The XML processor in a URL export doesn't export attachments or journal fields. To export attachments and journal fields like the Work Notes or Additional Comments fields, export the records from a list by using the Export > XML option in the context menu.
    4. オプション: Query for specific records by adding the sysparm_query parameter.
      The required syntax is sysparm_query=[column name][operator][value]. For example:
      https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1
      注:
      All queries use a column name, an operator, and a value. See Condition Builder for a list of available operators.
    5. オプション: Sort the records by column name using the sysparm_orderby parameter.
      The required syntax is sysparm_orderby=[column name]. 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 multiple orderby entries. For example:
      sysparm_query=ORDERBYassigned_to^ORDERBYpriority
    6. オプション: Export fields from a specific view using the sysparm_view parameter.
      The required syntax is sysparm_view=[view name]. For example:
      https://<instance name>.service-now.com/incident.do?CSV&sysparm_view=ess
      This URL exports incident fields visible from the Self Service (ess) view.
      • By default, exporting data from a list exports only the fields that are visible from the current view. If you want to export fields from another list view, you can switch views from the UI. See View management.
      • If you're exporting CSV or Excel data and don't specify a view, the export uses the default list view.
      • If you're exporting XML data, all fields are exported by default unless you specify a particular view.
    7. オプション: Export specific fields from the table using the sysparm_fields parameter.
      The required syntax is sysparm_fields=[field1],[field2]. For example:
      https://<instance name>.service-now.com/incident_list.do?CSV&sysparm_fields=sys_id,number
    8. オプション: Export all fields from the table, including the sys_id, using the sysparm_default_export_fields parameter.
      The required syntax is sysparm_default_export_fields=all. For example:
      https://<instance name>.service-now.com/incident_list.do?CSV&sysparm_default_export_fields=all
      The sysparm_default_export_fields parameter has no effect on XML exports unless you include the sysparm_view parameter to specify a non-default view.

    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.
    https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1&sysparm_orderby=assigned_to Export a list of all priority 1 incidents to an XML file and sort the list by Assigned to field.