The Zurich release has arrived! Interested in new features and functionalities? Click here for more

From a list view, can I use a UI action to copy the filter query to send to a script

Sheryl Lyke2
Tera Guru

Here's what I'm trying to do. From a list view, the user filters the list. Then they click a list link UI action which will copy the query to send to a GlideRecord as the encoded query. Is this possible?

1 ACCEPTED SOLUTION

Audrey Deruere
Mega Expert

Hi Sheryl Lyke,

 

You can use this function in the client part of the UI action : https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=r_GL2-getQuery_B_B_B_B

 

Then you can simply add an info message to display the encoded query

 

Regards,

Audrey

View solution in original post

5 REPLIES 5

Tim Deniston
Mega Sage
Mega Sage

If it's an admin user, they should be able to right-click the filter's breadcrumbs and select Copy Encoded Query. Is that not sufficient? Are these non-admin users you're talking about? 

Correct, non admin users. And I want it to happen when they click a button, not manually

I dug through Chrome's dev tools a bit and found that the Copy URL and Copy Sys ID context menu options are using "copyToClipboard("BLEEPBLOOP")" where "BLEEPBLOOP" is the string you want to land in the clipboard. Getting the encoded query might be the more fun part! 

Audrey Deruere
Mega Expert

Hi Sheryl Lyke,

 

You can use this function in the client part of the UI action : https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=r_GL2-getQuery_B_B_B_B

 

Then you can simply add an info message to display the encoded query

 

Regards,

Audrey