Product documentation Docs
    • English
    • Deutsch
    • 日本語
    • 한국어
    • Français
  • More Sites
    • Now Community
    • Developer Site
    • Knowledge Base
    • Product Information
    • ServiceNow.com
    • Training
    • Customer Success Center
    • ServiceNow Support Videos
  • Log in

Product documentation

  • Home
How search works:
  • Punctuation and capital letters are ignored
  • Special characters like underscores (_) are removed
  • Known synonyms are applied
  • The most relevant topics (based on weighting and matching to search terms) are listed first in search results
Topics are ranked in search results by how closely they match your search terms
  • A match on the entire phrase you typed
  • A match on part of the phrase you typed
  • A match on ALL of the terms in the phrase you typed
  • A match on ANY of the terms in the phrase you typed

Note: Matches in titles are always highly ranked.

  • Release version
    Table of Contents
    • Now Platform App Engine
Table of Contents
Choose your release version
    Home Orlando Now Platform App Engine Now Platform App Engine Web services Exporting and converting records into complex data types

    Exporting and converting records into complex data types

    • Save as PDF Selected topic Topic & subtopics All topics in contents
    • Unsubscribe Log in to subscribe to topics and get notified when content changes.
    • Share this page

    Exporting and converting records into complex data types

    Use URL parameters to export table records and convert them into complex data types, such as JSON, XML, PDF, CSV, and XLS.

    Exporting records as complex data types

    You can use an HTTP GET request to retrieve records from a table and put them in a specified format. For example, use the PDF parameter in a GET request to export records from a table as PDF files; use the XLS parameter to export records from a table as XLS files. For example, to retrieve a list of incident records as XLS files, issue an HTTP GET using the following URL: https://instance_name.service-now.com/incident.do?XLS. The file returned is incident.xls. incident.do is basically a GET that returns a list of the records from the incident table. The XLS parameter converts those records into XLS files.

    The general syntax is: https://<serviceNow-instance-name>/<table-name>.do?<Data-type-parameter>

    URL parameters

    The following table shows URL parameters you can use in GET requests, filters you can use to filter out unwanted table records in the return, and an indicator of whether you can POST the data type directly to a table. The parameter becomes the extension of the returned file, for example, using the XLS parameter returns a file in the form <table-name>.xls.
    Table 1. URL parameters
    Data type Parameter Valid filters Directly POST to table?
    CSV CSV sysparm_query, sysparm_view Y
    Excel XLS, EXCEL, XLSX sysparm_query, sysparm_view Y
    JSON JSONv2 Various. See JSON data retrieval API. Y
    PDF PDF sysparm_query, sysparm_view N
    RSS RSS sysparm_query, sysparm_view and more. See Limiting results with a view. N
    XML XML, XSD, SCHEMA sysparm_query, useUnloadFormat N

    For more information about retrieving and converting table records into the JSON file format, see JSONv2 Web Service.

    For more information about retrieving and converting table records into the RSS file format, see RSS feed generator.

    Converting records to PDFs

    For PDF export, there is a distinction between targeting a table and targeting its list. To generate a PDF of a list of records, suffix the target with _list. To target a single record, you must specify the sys_id parameter to identify the record for which you are generating the PDF.

    Filters

    All URL parameters work with filters that enable you to export a subset of table records. For example, sysparm_query=active=true in a GET request exports only active records. The following example exports only active incident records in an Excel format: https://instance_name.service-now.com/incident.do?EXCEL&sysparm_query=active=true.

    The general syntax is: https://<serviceNow-instance-name>/<table_list>.do?<Data-type-parameter>&<filter>

    Filters include:
    • sysparm_query—Filters the data using the encoded query before exporting files, for example, sysparm_query=active=true exports only active records.
    • sysparm_view—Specify the name of a list view to control which fields are returned. For example, to return the ESS view, use sysparm_view=ess.
    • useUnloadFormat—Indicates that the XML format returned is an unload format. The unload format is the same format you get when, from a list in the UI, you select Export > XML > ... You can import unload-formatted XML files back into the tables. To enable the unload format from a URL, use the useUnloadFormat=true URL parameter, for example, https://instance_name.service-now.com/incident.do?XML&useUnloadFormat=true.

    Example GET queries

    Table 2. GET request examples
    Data type Example query
    CSV https://instance_name.service-now.com/incident.do?CSV&sysparm_query=active=true
    Excel https://instance_name.service-now.com/incident.do?XLS&sysparm_query=active=true
    PDF https://instance_name.service-now.com/incident.do?PDF&sysparm_view=ess
    RSS https://instance_name.service-now.com/incident.do?RSS&sysparm_view=ess
    XML https://instance_name.service-now.com/incident.do?XML&sysparm_query=active=true

    Returned files

    GET queries return records from a table in the format specified in the request. For example, a query that uses the XLS parameter returns a table record in a file with the .xls extension.

    The Content-Disposition header in the response displays the file name and extension of the returned file. The file name is based on the table you export from, such as incident.xls, incident.pdf, or incident.xml.

    Exporting data into tables

    You can POST the following data types directly into tables:
    • CSV
    • Excel
    • JSON

    The file headers must match the field columns in the targeted table. For more information, see Post CSV or Excel files directly to an import set.

    Tags:

    Feedback
    On this page

    Previous topic

    Next topic

    • Contact Us
    • Careers
    • Terms of Use
    • Privacy Statement
    • Sitemap
    • © ServiceNow. All rights reserved.

    Release version
    Choose your release version

      Exporting and converting records into complex data types

      • Save as PDF Selected topic Topic & subtopics All topics in contents
      • Unsubscribe Log in to subscribe to topics and get notified when content changes.
      • Share this page

      Exporting and converting records into complex data types

      Use URL parameters to export table records and convert them into complex data types, such as JSON, XML, PDF, CSV, and XLS.

      Exporting records as complex data types

      You can use an HTTP GET request to retrieve records from a table and put them in a specified format. For example, use the PDF parameter in a GET request to export records from a table as PDF files; use the XLS parameter to export records from a table as XLS files. For example, to retrieve a list of incident records as XLS files, issue an HTTP GET using the following URL: https://instance_name.service-now.com/incident.do?XLS. The file returned is incident.xls. incident.do is basically a GET that returns a list of the records from the incident table. The XLS parameter converts those records into XLS files.

      The general syntax is: https://<serviceNow-instance-name>/<table-name>.do?<Data-type-parameter>

      URL parameters

      The following table shows URL parameters you can use in GET requests, filters you can use to filter out unwanted table records in the return, and an indicator of whether you can POST the data type directly to a table. The parameter becomes the extension of the returned file, for example, using the XLS parameter returns a file in the form <table-name>.xls.
      Table 1. URL parameters
      Data type Parameter Valid filters Directly POST to table?
      CSV CSV sysparm_query, sysparm_view Y
      Excel XLS, EXCEL, XLSX sysparm_query, sysparm_view Y
      JSON JSONv2 Various. See JSON data retrieval API. Y
      PDF PDF sysparm_query, sysparm_view N
      RSS RSS sysparm_query, sysparm_view and more. See Limiting results with a view. N
      XML XML, XSD, SCHEMA sysparm_query, useUnloadFormat N

      For more information about retrieving and converting table records into the JSON file format, see JSONv2 Web Service.

      For more information about retrieving and converting table records into the RSS file format, see RSS feed generator.

      Converting records to PDFs

      For PDF export, there is a distinction between targeting a table and targeting its list. To generate a PDF of a list of records, suffix the target with _list. To target a single record, you must specify the sys_id parameter to identify the record for which you are generating the PDF.

      Filters

      All URL parameters work with filters that enable you to export a subset of table records. For example, sysparm_query=active=true in a GET request exports only active records. The following example exports only active incident records in an Excel format: https://instance_name.service-now.com/incident.do?EXCEL&sysparm_query=active=true.

      The general syntax is: https://<serviceNow-instance-name>/<table_list>.do?<Data-type-parameter>&<filter>

      Filters include:
      • sysparm_query—Filters the data using the encoded query before exporting files, for example, sysparm_query=active=true exports only active records.
      • sysparm_view—Specify the name of a list view to control which fields are returned. For example, to return the ESS view, use sysparm_view=ess.
      • useUnloadFormat—Indicates that the XML format returned is an unload format. The unload format is the same format you get when, from a list in the UI, you select Export > XML > ... You can import unload-formatted XML files back into the tables. To enable the unload format from a URL, use the useUnloadFormat=true URL parameter, for example, https://instance_name.service-now.com/incident.do?XML&useUnloadFormat=true.

      Example GET queries

      Table 2. GET request examples
      Data type Example query
      CSV https://instance_name.service-now.com/incident.do?CSV&sysparm_query=active=true
      Excel https://instance_name.service-now.com/incident.do?XLS&sysparm_query=active=true
      PDF https://instance_name.service-now.com/incident.do?PDF&sysparm_view=ess
      RSS https://instance_name.service-now.com/incident.do?RSS&sysparm_view=ess
      XML https://instance_name.service-now.com/incident.do?XML&sysparm_query=active=true

      Returned files

      GET queries return records from a table in the format specified in the request. For example, a query that uses the XLS parameter returns a table record in a file with the .xls extension.

      The Content-Disposition header in the response displays the file name and extension of the returned file. The file name is based on the table you export from, such as incident.xls, incident.pdf, or incident.xml.

      Exporting data into tables

      You can POST the following data types directly into tables:
      • CSV
      • Excel
      • JSON

      The file headers must match the field columns in the targeted table. For more information, see Post CSV or Excel files directly to an import set.

      Tags:

      Feedback

          Share this page

          Got it! Feel free to add a comment
          To share your product suggestions, visit the Idea Portal.
          Please let us know how to improve this content

          Check any that apply

          To share your product suggestions, visit the Idea Portal.
          Confirm

          We were unable to find "Coaching" in Jakarta. Would you like to search instead?

          No Yes
          • Contact Us
          • Careers
          • Terms of Use
          • Privacy Statement
          • Sitemap
          • © ServiceNow. All rights reserved.

          Subscribe Subscribed Unsubscribe Last updated: Tags: January February March April May June July August September October November December No Results Found Versions Search preferences successfully updated My release version successfully updated My release version successfully deleted An error has occurred. Please try again later. You have been unsubscribed from all topics. You are now subscribed to and will receive notifications if any changes are made to this page. You have been unsubscribed from this content Thank you for your feedback. Form temporarily unavailable. Please try again or contact  docfeedback@servicenow.com  to submit your comments. The topic you requested does not exist in the release. You were redirected to a related topic instead. The available release versions for this topic are listed There is no specific version for this documentation. Explore products Click to go to the page. Release notes and upgrades Click to open the dropdown menu. Delete Remove No selected version Reset This field is required You are already subscribed to this topic Attach screenshot The file you uploaded exceeds the allowed file size of 20MB. Please try again with a smaller file. Please complete the reCAPTCHA step to attach a screenshot
          Log in to personalize your search results and subscribe to topics
          No, thanks Login