Get the incident table records as a csv file using the rest integration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 09:00 PM
Hello Guys,
I have to get the incident table records as a csv file using the rest api explorer or integration, Please guide me how to achieve the same.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 09:05 PM
Open the ServiceNow instance and navigate to the "REST API Explorer" by typing "REST API Explorer" in the navigation bar.
In the REST API Explorer, expand the "Table API" section and select "GET /api/now/table/{tableName}".
Replace {tableName} with "incident" to get the records from the Incident table.
In the "Request Parameters" section, add the "sysparm_query" parameter with the value of the query that filters the records you want to retrieve.
In the "Request Headers" section, add the "Accept" header with the value of "text/csv" to specify the response format as CSV.
Click on the "Try it out" button to execute the request.
The response will be a CSV file containing the records that match the query you specified. You can download the CSV file by right-clicking on the "Response body" section and selecting "Save As".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 02:10 AM
Hello Sankar,
we dont have text/csv option in rest api explerer and also when i try to achieve the same using post man
GET "https://dev120611.service-now.com/api/now/table/incident?sysparm_query=active%3Dtrue"
and we got error msg as below(refer screenshot)