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-06-2017 01:35 PM
I would recommend creating a new view on the list of table. Include which fields you would like to have in that view. use following URL
https://<instance_url>/task_list.do?sysparm_view=<view_name>
Thanks,
Sai
Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2017 01:13 AM
That seems to have solved it. Thanks so much for your advice!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2017 06:40 AM
Awesome. if this solves your problem, please mark it as correct Answer. it helps other people who have this issue in future. if you have any other road blocks please let us know.
Thanks,
Sai.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 02:18 PM
Finlay Wright wrote:
t that needs to be able to do an HTTP request to pull out a CSV of a search on Service Now.
Does it need to be CSV? Would XML or JSON be easier to parse at the receiving end?