What’s the difference between GlideRecord’s addQuery() vs. encoded queries – when to use which?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2025 04:38 AM
What’s the difference between GlideRecord’s addQuery() vs. encoded queries – when to use which?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2025 05:12 AM
Hi @dalvipranit
Here the best explanation
using addQuery() you can give filter based upon the one field,
using addEncodedQuery() you can filter the record based upon the multiple fileds (you can copy the breadcrumb string and use as it is in encoded query under quotes).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2025 11:41 PM
Hi @dalvipranit , The difference between addQuery() and addEncodedQuery() is in case you want to add some simple query like ('state', 'new') the addQuery() would suit best here. But in case where you will need to add more complex and complex filters/queries like more than 2 or 3 conditions at the same time at that time the addEncodedQuery() will be the best as it will directly add the condition you want in a single line instead of adding multiple queries in different line.
So, which should you use, as I told in case you want more complex logic and conditions use encodedQuery() and in case your condition is not complex use addQuery().
Hope this helps you!
If this solution helped you Please Mark this solution as accepted and helpful as it will be helpful for other users as well.
Best Regards.
Saurabh V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2025 10:07 AM
Hi @dalvipranit , Hope you are doing well, Did my answer helped you in any way??
If my answers given earlier were helpful then Please Mark this solution as accepted and helpful as it will be helpful for other users as well.
Best Regards.
Saurabh V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2025 09:56 PM
Hi @dalvipranit , Did my answer helped you in any way??
IF yes then make sure to accept it as a solution and mark it as helpful as this will benefit other users and readers as well.
Best Regards,
Saurabh V.
