The CreatorCon Call for Content is officially open! Get started here.

Filter OR condition (Encoded Query)

Ereshkigal
Tera Contributor

Everyone in the community!
Always I am indebted.

I have added the following refinement settings to the Query Parameter of the Scripted API.

If a specific character string is included in the Short description of Incident,
There is a requirement to extract.

Set the following filter conditions from the Incident list
find_real_file.png

Get the following query from Copy Query and add it to QueryParameter

short_descriptionLIKEATF^ORshort_descriptionLIKETEST^ORshort_descriptionLIKESAP

What I was curious about was that this query contained a short_description every time.
Let me check the following 3 points

  1. As you add query conditions, this query will get longer, Is there an upper limit?
  2. Also, if there is an upper limit, is it possible to reduce the number of characters by omitting short_description?
  3. Will the query fail if the limit is exceeded, or will the query be executed only for the reduced part?

Thank you!

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

I doubt you will find any documentation around this in docs regarding the max length

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Kalyani Jangam1
Mega Sage

Hi, you can use encoded query like below also by omitting short_description every times

find_real_file.png

But it affect on count of record because in one of it exactly show that data that match the character and contains consists more data

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi,

Sorry for coming in late. My notifications are coming in over 3 days late.

Not fully understanding the question. Is the question about trying to implement "sysparm_query" parameter in table API in scripted API?

find_real_file.png

If so, why not just use table API? Scripted API shouldn't have to query using encoded query. It should be more business focused API and not a general table query.

Scripted API can have finer  ACL security constraints to limit API to certain condition. Allowing encoded query to be passed seems to be defeating that purpose.