Export a list and include the URL to the record?

Jared Wason
Tera Guru

Hello,

I am trying to export a list of incidents to excel and I would like for the export to have a link to the record. Currently, I am filtering my list and then adding '&EXCEL&sysparm_default_export_fields=all' to the URL to export. Then in Excel, I am able to craft a URL via the sys_id and a generic incident link, however, this is cumbersome. Is it possible to export a list with the URL already available? If that is not possible, is it possible to export the sys_id directly instead of using 'sysparm_defaul_export_fields=all'? That adds every column which makes the Excel page very cluttered and requires additional clean-up.

 

Thanks! 

1 ACCEPTED SOLUTION

Hi Jared,

I found this solution that will work better for you:

https://developer.servicenow.com/blog.do?p=/post/exporting-data-with-sys-ids/

For example, if you want to export all fields from your incident table, you can use the following url:

https://instance.service-now.com/incident_list.do?CSV&sysparm_default_export_fields=all

(replace instance by your instance name)


If you want to exporto only a couple of fields, replace the sysparm_default_export_fields=true by sysparm_fields=<comma-separated list of fields>.
As example, if you want to export sys_id, name and short description, you use the following url:

https://instance.service-now.com/incident_list.do?CSV&sysparm_fields=sys_id,number,short_description

And the result will be like this:

find_real_file.png

I think this is what you need!

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards,

Filipe Cruz

View solution in original post

5 REPLIES 5

Filipe Cruz
Kilo Sage
Kilo Sage

Hello Jared,

You can add the sys_id of your records to a list view and then export that to excel:

Add sys_id column to List View

You can also try to create a string field in your table and have an after insert business rule setting that field with the link to the record.
Then, when exporting that to excel, you will directly have the link to the record.

Hope these two options will help you!!

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards,

Filipe Cruz

Hi Filipe,

The first option did work to get the sys_id into the column list view. Unfortunately though when I then go to export the list, that column is not included which defeats my purpose. 

Hi Jared,

I found this solution that will work better for you:

https://developer.servicenow.com/blog.do?p=/post/exporting-data-with-sys-ids/

For example, if you want to export all fields from your incident table, you can use the following url:

https://instance.service-now.com/incident_list.do?CSV&sysparm_default_export_fields=all

(replace instance by your instance name)


If you want to exporto only a couple of fields, replace the sysparm_default_export_fields=true by sysparm_fields=<comma-separated list of fields>.
As example, if you want to export sys_id, name and short description, you use the following url:

https://instance.service-now.com/incident_list.do?CSV&sysparm_fields=sys_id,number,short_description

And the result will be like this:

find_real_file.png

I think this is what you need!

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards,

Filipe Cruz

Hi @Filipe Cruz 
Even though this is helpful information, I'm not seeing it responding the original question which was to get the URL for the records in a list.