Copy SysIDs in Bulk
Did you ever get any use case where you need to copy SysIDs in bulk from a list view.
The use case can be:
There is some matrix that you need to validate in your script. You need to store the sysids in a property. One option is to export the CSV with Sys id field using ?CSV&sysparm_default_export_fields=all method, then convert in comma separated list.
I created a small utility which will help copy the sysids from any list. You can download the Utility from here or follow below steps
Copy SysIDs in Bulk — Share | ServiceNow Developers
- Navigate to System Definitions > UI Actions > Create New
- Give the Name of your choice e.g “Copy Bulk SysIDs”
- Select Table as “Global” so it is available on every list.
- Tick the Client and List choice field checkbox and call the function in Onclick field
- Write below code inside the function in Script field.
var sysIds = g_list.getChecked();
copyToClipboard(sysIds);
Here is a snapshot of UI Action
6. Save the UI Action and start using it :)
Happy Learning!
Thanks
Deepak
Follow me on LinkedIn