From eba9056860192154c476df8bb94d24901763508a Mon Sep 17 00:00:00 2001 From: Brad Bowman Date: Sun, 12 Oct 2025 13:53:52 -0400 Subject: [PATCH 1/4] Create readme.md --- .../Load List with Query/readme.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md diff --git a/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md b/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md new file mode 100644 index 0000000000..e42bf01d31 --- /dev/null +++ b/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md @@ -0,0 +1,21 @@ +Sometimes you can't include the condition you want in a graphical list filter, but a (GlideRecord) encoded query is valid. + +An Example: +On my sc_request table I have created a field with the type Name-Value Pairs to store address information that will accommodate varying global formats (dynamic content and number of fields). This field type allows you to add as many pairs as needed to each record. +The value of this field is stored in JSON, containing the Name and Value of each pair added: +{"Street":"123 Main St","City":"MyCity","State":"MyState","Zip":"90210"} + +Business Case: +If I need to find all of the Request records that contain a certain City name, Zip Code, Street name or address etc., I cannot do so in a list view of the Request table, as the only conditions available are 'is', 'is not', or 'is anything': +There are probably other useful conditions missing for various field types. + +In a script, I can get the records I'm looking for via GlideRecord using an encoded query. As a simple example, let's say I want to retrieve all of the records that contain 'Main St': + +'u_addressLIKEmain st' + +The Workaround: +By adding a sysparm_query to the URL, the list will be filtered appropriately. The above encoded query resolves like this when added to the end of a URL: +https://instancename.service-now.com/now/nav/ui/classic/params/target/sc_request_list.do%3Fsysparm_query%3Du_addressLIKEmain%2520st + +When doing this, you will see the correct filter reflected in the breadcrumb, but here is the best part - now when you expand the filter via the funnel icon, 'contains' is a valid operator, so you can change the text/value to whatever else you are looking for! +While this is a simple example, passing in a complex encoded query with ANDs and ORs will also work to filter the records and update the filter where building the filter manually is limited. From d3d819ba8b54f35549fc2b65ecb809be42dfb5fb Mon Sep 17 00:00:00 2001 From: Brad Bowman Date: Sun, 12 Oct 2025 14:16:25 -0400 Subject: [PATCH 2/4] Create listquery.html --- .../Browser Bookmarklets/Load List with Query/listquery.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 Specialized Areas/Browser Bookmarklets/Load List with Query/listquery.html diff --git a/Specialized Areas/Browser Bookmarklets/Load List with Query/listquery.html b/Specialized Areas/Browser Bookmarklets/Load List with Query/listquery.html new file mode 100644 index 0000000000..8398e93657 --- /dev/null +++ b/Specialized Areas/Browser Bookmarklets/Load List with Query/listquery.html @@ -0,0 +1 @@ +RITM Addresses From 28166db03f739ba3552cf43e1caa1455227bea68 Mon Sep 17 00:00:00 2001 From: Brad Bowman Date: Sun, 12 Oct 2025 14:21:19 -0400 Subject: [PATCH 3/4] Update readme.md --- .../Browser Bookmarklets/Load List with Query/readme.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md b/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md index e42bf01d31..edd394d593 100644 --- a/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md +++ b/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md @@ -17,5 +17,11 @@ The Workaround: By adding a sysparm_query to the URL, the list will be filtered appropriately. The above encoded query resolves like this when added to the end of a URL: https://instancename.service-now.com/now/nav/ui/classic/params/target/sc_request_list.do%3Fsysparm_query%3Du_addressLIKEmain%2520st +Where sc_rquest is the table name +u_address is the field name to query on +and the rest is the encoded query + When doing this, you will see the correct filter reflected in the breadcrumb, but here is the best part - now when you expand the filter via the funnel icon, 'contains' is a valid operator, so you can change the text/value to whatever else you are looking for! While this is a simple example, passing in a complex encoded query with ANDs and ORs will also work to filter the records and update the filter where building the filter manually is limited. + +This bookmarklet is formatted to open a new tab when logged into an instance. From 96a667ff40038b74b31a65dc3cfe3df0d2ff7a79 Mon Sep 17 00:00:00 2001 From: Brad Bowman Date: Sun, 12 Oct 2025 14:22:12 -0400 Subject: [PATCH 4/4] Update readme.md --- .../Browser Bookmarklets/Load List with Query/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md b/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md index edd394d593..cb426598ad 100644 --- a/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md +++ b/Specialized Areas/Browser Bookmarklets/Load List with Query/readme.md @@ -17,8 +17,8 @@ The Workaround: By adding a sysparm_query to the URL, the list will be filtered appropriately. The above encoded query resolves like this when added to the end of a URL: https://instancename.service-now.com/now/nav/ui/classic/params/target/sc_request_list.do%3Fsysparm_query%3Du_addressLIKEmain%2520st -Where sc_rquest is the table name -u_address is the field name to query on +Where sc_rquest is the table name, +u_address is the field name to query on, and the rest is the encoded query When doing this, you will see the correct filter reflected in the breadcrumb, but here is the best part - now when you expand the filter via the funnel icon, 'contains' is a valid operator, so you can change the text/value to whatever else you are looking for!