Copy SysIDs in Bulk

Deepak Negi
2 min readAug 17, 2023

--

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

  1. Navigate to System Definitions > UI Actions > Create New
  2. Give the Name of your choice e.g “Copy Bulk SysIDs”
  3. Select Table as “Global” so it is available on every list.
  4. Tick the Client and List choice field checkbox and call the function in Onclick field
  5. 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

--

--

Deepak Negi
Deepak Negi

Written by Deepak Negi

Meet Deepak,the tech wizard and adventure enthusiast. When he's not coding on SN,you can find him exploring the mountains or searching for places with good food

No responses yet