
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2019 07:02 AM
I have 2 different scenarios to inquire about.
Scenario 1:
var gr = new GlideRecord('incident');
gr.addQuery('category', 'hrissue');
gr.addQuery('active', true);
gr.addEncodedQuery('priority=2^u_rc_ticket=a346b78c1011de1a346b78c1011de133');
gr.query();
Scenario 2:
var gr = new GlideRecord('incident');
gr.addEncodedQuery('category=hrissue');
gr.addEncodedQuery('active=true');
gr.addEncodedQuery('priority=2^u_rc_ticket=a346b78c1011de1a346b78c1011de133');
gr.query();
In Scenario 1,
- Is it possible to mix addQuery() with addEncodedQuery()?
If so, does it matter what order they are in?
In Scenario 2,
- Is it possible to have multiple addEncodedQuery() declarations? Or will each one overwrite the previous one?
These are simply curiosity questions.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2019 07:08 AM
Just tested, scenario 2 works also. You can use multiple addEncodedQuery statements.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2019 07:04 AM
Hi there,
For scenario 1: Yes you can use both. The order does matter if you are looking at performance.
For scenario 2: I have never tried that actually. Have to simulate 🙂
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2019 07:08 AM
Just tested, scenario 2 works also. You can use multiple addEncodedQuery statements.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2019 07:19 AM
Mark, thanks for taking the time to test this!