<h2>Export directly from a URL</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2025" /><meta name="DC.rights.owner" content="(C) Copyright 2025" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="task" /><meta name="DC.title" content="Export directly from a URL" /><meta name="abstract" content="Dynamically export data from a script or web service by building a URL query." /><meta name="description" content="Dynamically export data from a script or web service by building a URL query." /><meta name="DC.subject" content="Exporting Data, export data, Export Data, export directly from the URL" /><meta name="keywords" content="Exporting Data, export data, Export Data, export directly from the URL" /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-08-03" /><meta name="DC.date.modified" content="2024-02-01" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="t_ExportDirectlyFromTheURL" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>Export directly from a URL</title></head><body id="t_ExportDirectlyFromTheURL"> <h1 class="title topictitle1" id="ariaid-title1">Export directly from a URL</h1> <div class="body taskbody"><p class="shortdesc">Dynamically export data from a script or web service by building a URL query.</p> <div class="section prereq p" id="t_ExportDirectlyFromTheURL__prereq_twv_vvw_ytb"> <p class="p">Role required: None</p> <div class="note"><span class="notetitle">Note:</span> <span class="ph">ServiceNow</span> enforces <a class="xref" href="http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#BasicAA" target="_blank" rel="noopener noreferrer">basic authentication</a> for direct URL access. The data extracted from the URL contains only the fields to which the currently authenticated user has read access.</div> </div> <div class="section context"> <p class="p">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.</p> <p class="p">You must be familiar with the <span class="ph">ServiceNow</span> table and column names to export data directly from the URL. See <a class="xref" href="https://docs.servicenow.com/csh?topicname=navigate-using-url&version=washingtondc&pubname=washingtondc-platform-user-interface" target="_blank" rel="noopener noreferrer">Navigate to a record or a module using a URL</a>.</p> <div class="p">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. <ul class="ul" id="t_ExportDirectlyFromTheURL__ul_af1_cqb_j1c"><li class="li">For details on using query parameters, see <a class="xref" href="https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/exporting-data/concept/query-parameters-display-value.html" title="Use query parameters to export the display value or raw value of fields and the field label or field name for headers.">Query parameters for display value and header</a>.</li><li class="li">For details on using system properties, see <a class="xref" href="https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/exporting-data/concept/system-properties-display-value-header.html" title="Use system properties to export the display value or raw value of fields and the field label or field name for headers.">System properties for display value and header</a>.</li></ul> Query parameters, if present, override system properties.</div> </div> <ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd">Specify the instance URL.</span> <div class="itemgroup info">For example:<pre class="pre codeblock"><code>https://<instance name>.service-now.com/</code></pre> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Specify the table form or list to export.</span> <div class="itemgroup info">For example:<pre class="pre codeblock"><code>incident_list.do</code></pre></div> </li><li class="li step stepexpand"> <span class="ph cmd">Specify the export format processor to use for the export.</span> <div class="itemgroup info">You can specify CSV, XLS, JSON, XLSX, or XML. For example: <pre class="pre codeblock"><code>?CSV</code></pre><div class="note"><span class="notetitle">Note:</span> The XML processor in a URL export doesn't export attachments or journal fields. To export attachments and journal fields like the <span class="ph uicontrol">Work Notes</span> or <span class="ph uicontrol">Additional Comments</span> fields, export the records from a list by using the <span class="ph menucascade"><span class="ph uicontrol">Export</span> > <span class="ph uicontrol">XML</span></span> option in the context menu.</div> </div> </li><li class="li step stepexpand"><strong>Optional: </strong> <span class="ph cmd">Query for specific records by adding the <span class="keyword parmname">sysparm_query</span> parameter.</span> <div class="itemgroup info">The required syntax is <code class="ph codeph">sysparm_query=[column name][operator][value]</code>. For example:<pre class="pre codeblock"><code>https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1</code></pre><div class="note"><span class="notetitle">Note:</span> All queries use a column name, an operator, and a value. See <a class="xref" href="https://docs.servicenow.com/csh?topicname=c_ConditionBuilder&version=washingtondc&pubname=washingtondc-platform-user-interface" target="_blank" rel="noopener noreferrer">Condition Builder</a> for a list of available operators.</div> </div> </li><li class="li step stepexpand"><strong>Optional: </strong> <span class="ph cmd">Sort the records by column name using the <span class="keyword parmname">sysparm_orderby</span> parameter.</span> <div class="itemgroup info">The required syntax is <code class="ph codeph">sysparm_orderby=[column name]</code>. For example:<pre class="pre codeblock"><code>https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1&sysparm_orderby=assigned_to</code></pre><div class="note"><span class="notetitle">Note:</span> You can sort by only one column using <span class="keyword parmname">sysparm_orderby</span>. To sort by multiple columns, use multiple orderby entries. For example:<pre class="pre codeblock"><code>sysparm_query=ORDERBYassigned_to^ORDERBYpriority</code></pre></div> </div> </li><li class="li step stepexpand"><strong>Optional: </strong> <span class="ph cmd">Export fields from a specific view using the <span class="keyword parmname">sysparm_view</span> parameter.</span> <div class="itemgroup info">The required syntax is <code class="ph codeph">sysparm_view=[view name]</code>. For example:<pre class="pre codeblock"><code>https://<instance name>.service-now.com/incident.do?CSV&sysparm_view=ess</code></pre>This URL exports incident fields visible from the Self Service (ess) view.<ul class="ul" id="t_ExportDirectlyFromTheURL__ul_wh5_vbb_j1c"><li class="li">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 <a class="xref" href="https://docs.servicenow.com/csh?topicname=view-management-overview&version=washingtondc&pubname=washingtondc-platform-user-interface" target="_blank" rel="noopener noreferrer">View management</a>.</li><li class="li">If you're exporting CSV or Excel data and don't specify a view, the export uses the default list view.</li><li class="li">If you're exporting XML data, all fields are exported by default unless you specify a particular view.</li></ul> </div> </li><li class="li step stepexpand"><strong>Optional: </strong> <span class="ph cmd">Export specific fields from the table using the <span class="keyword parmname">sysparm_fields</span> parameter.</span> <div class="itemgroup info">The required syntax is <code class="ph codeph">sysparm_fields=[field1],[field2]</code>. For example:<pre class="pre codeblock"><code>https://<instance name>.service-now.com/incident_list.do?CSV&sysparm_fields=sys_id,number</code></pre></div> </li><li class="li step stepexpand"><strong>Optional: </strong> <span class="ph cmd">Export all fields from the table, including the sys_id, using the <span class="keyword parmname">sysparm_default_export_fields</span> parameter.</span> <div class="itemgroup info">The required syntax is <code class="ph codeph">sysparm_default_export_fields=all</code>. For example:<pre class="pre codeblock"><code>https://<instance name>.service-now.com/incident_list.do?CSV&sysparm_default_export_fields=all</code></pre>The <span class="keyword parmname">sysparm_default_export_fields</span> parameter has no effect on XML exports unless you include the <span class="keyword parmname">sysparm_view</span> parameter to specify a non-default view.</div> </li></ol> <div class="example" id="t_ExportDirectlyFromTheURL__example_jsn_fl1_j1c"><h2 class="title sectiontitle">Sample URLs</h2> <div class="p"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="t_ExportDirectlyFromTheURL__table_rgt_hgl_2r" class="table" frame="border" border="1" rules="all"><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d492135e300">URL</th><th class="entry cellrowborder" style="vertical-align:top;" id="d492135e303">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d492135e300 ">https://<instance name>.service-now.com/incident_list.do?CSV</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d492135e303 ">Export all incidents to a comma-separated value text file.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d492135e300 ">https://<instance name>.service-now.com/incident_list.do?CSV&sysparm_query=sys_id%3E%3Db4aedb520a0a0b1001af10e278657d27</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d492135e303 ">Export a particular incident to a comma-separated value text file.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d492135e300 ">https://<instance name>.service-now.com/incident_list.do?CSV&sysparm_orderby=sys_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d492135e303 ">Export all incidents to a comma-separated value text file and sort the list by sys_id.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d492135e300 ">https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1&sysparm_orderby=assigned_to</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d492135e303 ">Export a list of all priority 1 incidents to an XML file and sort the list by <span class="ph uicontrol">Assigned to</span> field.</td></tr></tbody></table> </div> </div> </div> </div> </body></html></div>