An easy way to identify the encoded query string to use is to create a filter or a module with the query parameters you want to use, and then hover over the link or breadcrumb and look at the URL. The part of the URL after ‘sysparm_query=’ is the encoded query for that link., The addEncodedQuery function allows you to add a query to a GlideRecord object using an encoded query string. An encoded query string is a string that represents a query in a URL-friendly format. This format is typically used in URLs to represent complex queries with special characters or operators., The standard ‘addQuery’ parameter acts like an ‘and’ condition in your query. This example shows how you can add ‘or’ conditions to your query., Developers can use the addEncodedQuery() method to take the encoded query from a filter and apply it in a script. The topics in this post build on concepts in the GlideRecord concepts in the Server-side Scripting module., You can build out a GlideRecord query with 10 lines of code, or you can simply copy an “encoded query” and have ServiceNow build it out for you. You essentially are defining a query that is encoded and truncated and using that as your parameter for your method in a GlideRecord., GlideRecord has the "addedEncodedQuery" method for putting in encoded queries, and it has a getEncodedQuery for turning the current query into an encoded string. If you instantiate a GlideRecord object, and pass it an invalid query string like this: myGr.addEncodedQuery('invalid_field_foo=BAR');.