Exporting Sysids to a spreadsheet (CSV web service)

really useful post on how to get sysids added as a column to a CSV export (CSV web service)
https://developer.servicenow.com/blog.do?p=/post/exporting-data-with-sys-ids/

in a nutshell:

- edit the system property

SYSPARM_DEFAULT_EXPORT_FIELDS

to add in the sys id column, or just add as a parameter to the URL like so:
https://instance.service-now.com/incident_list.do?CSV&sysparm_default_export_fields=all

- fire the URL at the instance, e.g. 'active tickets where vendor = <a vendor>', examples:
https://instance.service-now.com/incident.do?CSV&sysparm_query=priority=1^active=true

https://instance.service-now.com/incident.do?CSV&sysparm_default_export_fields=all&sysparm_query=priority=1^active=true

https://instance.service-now.com/incident.do?CSV&CSV&sysparm_default_export_fields=all&sysparm_query=active=true^u_vendor=91c6f451371e420041c5616043990eee


this format seems to work also without editing the sys properties:


https://<instance>.service-now.com/incident.do?CSV&sysparm_query=u_vendor=91c6f451371e420041c5616043990eee&sysparm_fields=number,sys_id,correlation_display,correlation_id,u_vendor,u_vendor_group,u_vendor_reference_number


example on sys_choice table:

https://<instance>.service-now.com/sys_choice.do?CSV&sysparm_query=name=problem^ORname=problem_task^element=state^inactive=false&sysparm_fields=name,sys_id,label,value




Comments

Popular posts from this blog

GlideRecord setValue

variable advanced reference qualifier example

Running transform maps asynchronously