Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

AddQuery vs AddEncodedQuery

Anubhav24
Mega Sage

Hi All,

 

Is there a difference between addquery and addencodedquery. Is there a performance difference between these two considering 2 scenarios : a) When only column value is being matched b)When multiple column values are being matched?

Eventually the query gets converted to "Select *" format right ?

 

11 REPLIES 11

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Interesting question, never really gave it a thought if there would be a possible performance difference between the two, assuming that the end query is the same of course.

I do see some responses on this topic already, though those don't look to go into your actual question.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi @Mark Roethof,

Yes I am working on one project for improving the performance and I was suggested to try and avoid EncodedQuery function , hence i wanted to understand what is the basic difference which helps to improve the performance or there is nothing like performance improvement to it ?

Do wonder immediately, who suggested you that? Because that person should than also be able to provide you with a proper "why"?

 

I usually do the opposite, using encoded queries as much as possible 🙂 Though don't know of any difference in performance in this.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Mark Roethof
Tera Patron
Tera Patron

I posted your question on SNDevs Slack, maybe someone there knows about this.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Thank you 🙂