Specifying fields in CSV export
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 01:01 PM
Hi,
I'm pretty new to developing with ServiceNow so any pointers on this one would be much appreciated. I'm creating a Google Apps Script writing a script that needs to be able to do an HTTP request to pull out a CSV of a search on Service Now. I have it working, however the CSV that is downloaded always contains the fields that I have set up in my dashboard when I log in through the web. For example, if in the web console, I have customised it to show me the state of a ticket and the date it was opened, that's what is outputted onto the CSV.
Below is an example of the URL I'm putting in requests, if you've any pointers on how to specify which fields to include, that would be much appreciated. Thanks!
https://INSTANCE.service-now.com/task_list.do?CSV&sysparm_query=sys_class_name%3Dchange_request%5Eactive%3Dtrue%5Estate!%3D-50%5Ecompany!%3Df66b14e1c611227b0166c3a0df4046ff&sysparm_first_row=1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2017 12:54 AM
CSV is the format I need it in I'm afraid

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2017 11:00 AM
Although I couldn't find it in any documentation, sysparm_fields (from the REST Table API) works for me when using the CSV web service.
CSV Docs: CSV Web service parameters
Table API Docs: Table API - GET /now/table/{tableName}
e.g.
/sys_user.do?CSV&sysparm_query=active=true&sysparm_fields=employee_number,active,email,first_name,last_name,phone