{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":39971,"path":"platform-administration/table-administration-and-data-management/t_ExportDirectlyFromTheURL.md","title":"Export directly from a URL","bundle":null,"doc_type":null,"release":"australia","body":"\n# Export directly from a URL\n\nDynamically export data from a script or web service by building a URL query.\n\n## Before you begin\n\nRole required: None\n\n**Note:** ServiceNow enforces [basic authentication](http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#BasicAA) for direct URL access. The data extracted from the URL contains only the fields to which the currently authenticated user has read access.\n\n## About this task\n\nYou 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.\n\nYou 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-user-interface/navigate-using-url.md).\n\nYou 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.\n\n-   For details on using query parameters, see [Query parameters for display value and header](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/table-administration-and-data-management/query-parameters-display-value.md).\n-   For details on using system properties, see [System properties for display value and header](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/table-administration-and-data-management/system-properties-display-value-header.md).\n\nQuery parameters, if present, override system properties.\n\n## Procedure\n\n1.  Specify the instance URL.\n\n    For example:\n\n    ```\n    https://<instance name>.service-now.com/\n    ```\n\n2.  Specify the table form or list to export.\n\n    For example:\n\n    ```\n    incident_list.do\n    ```\n\n3.  Specify the export format processor to use for the export.\n\n    You can specify CSV, XLS, JSON, XLSX, or XML. For example:\n\n    ```\n    ?CSV\n    ```\n\n    **Note:** 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** &gt; **XML** option in the context menu.\n\n4.  Query for specific records by adding the **sysparm\\_query** parameter.\n\n    The required syntax is `sysparm_query=[column name][operator][value]`. For example:\n\n    ```\n    https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1\n    ```\n\n    **Note:** All queries use a column name, an operator, and a value. See [Condition Builder](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-user-interface/c_ConditionBuilder.md) for a list of available operators.\n\n5.  Sort the records by column name using the **sysparm\\_orderby** parameter.\n\n    The required syntax is `sysparm_orderby=[column name]`. For example:\n\n    ```\n    https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1&sysparm_orderby=assigned_to\n    ```\n\n    **Note:** You can sort by only one column using **sysparm\\_orderby**. To sort by multiple columns, use multiple orderby entries. For example:\n\n    ```\n    sysparm_query=ORDERBYassigned_to^ORDERBYpriority\n    ```\n\n6.  Export fields from a specific view using the **sysparm\\_view** parameter.\n\n    The required syntax is `sysparm_view=[view name]`. For example:\n\n    ```\n    https://<instance name>.service-now.com/incident.do?CSV&sysparm_view=ess\n    ```\n\n    This URL exports incident fields visible from the Self Service \\(ess\\) view.\n\n    -   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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-user-interface/view-management-overview.md).\n    -   If you're exporting CSV or Excel data and don't specify a view, the export uses the default list view.\n    -   If you're exporting XML data, all fields are exported by default unless you specify a particular view.\n7.  Export specific fields from the table using the **sysparm\\_fields** parameter.\n\n    The required syntax is `sysparm_fields=[field1],[field2]`. For example:\n\n    ```\n    https://<instance name>.service-now.com/incident_list.do?CSV&sysparm_fields=sys_id,number\n    ```\n\n8.  Export all fields from the table, including the sys\\_id, using the **sysparm\\_default\\_export\\_fields** parameter.\n\n    The required syntax is `sysparm_default_export_fields=all`. For example:\n\n    ```\n    https://<instance name>.service-now.com/incident_list.do?CSV&sysparm_default_export_fields=all\n    ```\n\n    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.\n\n\n## Sample URLs\n\n|URL|Description|\n|---|-----------|\n|https://&lt;instance name&gt;.service-now.com/incident\\_list.do?CSV|Export all incidents to a comma-separated value text file.|\n|https://&lt;instance name&gt;.service-now.com/incident\\_list.do?CSV&amp;sysparm\\_query=sys\\_id%3E%3Db4aedb520a0a0b1001af10e278657d27|Export a particular incident to a comma-separated value text file.|\n|https://&lt;instance name&gt;.service-now.com/incident\\_list.do?CSV&amp;sysparm\\_orderby=sys\\_id|Export all incidents to a comma-separated value text file and sort the list by sys\\_id.|\n|https://&lt;instance name&gt;.service-now.com/incident\\_list.do?XML&amp;sysparm\\_query=priority=1&amp;sysparm\\_orderby=assigned\\_to|Export a list of all priority 1 incidents to an XML file and sort the list by **Assigned to** field.|\n\n"}}