Query by name start with, does not work correctly

gabriel_sk
Tera Contributor

Hello team,

I noticed a weird behavior when querying a specific table (Software Packages) from the list view or via a reference field pointing to the name field.

This table contain records having multiple words in the name field: ex. Acrobat Reader.

When searching for "Name start with: Acrobat R" the result is no records to display.

If I search for "Name start with: Acrobat"   the record is displayed.

Somehow it does not like the space in the query.

Now, what is weird is that this occurs apparently only on that table and on that specific instance. I have another dev personal instance where this issue does not occur at all. I can search for start with word space word and records are displayed.

Both are on Istanbul.

Any suggestion, comment is appreciated:)

Thank you so much and have a great week end!

3 REPLIES 3

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Are you sure the name really starts with "Acrobat R" and there is nothing in there? What if you look at the XML of the record, how is the name displayed?


Hi Sergiu,



Yep, everything appears to be correct. And Adobe was just an example... There are multiple entries having in the name field multiple words.


If in "Name start with" after the first word there is a space, nothing is displayed.   same if the query is "Name Contains"


But on another instance, this issue does not occur so weird.



Thx!


Hi Gabriel,



What if you, as admin, enable debug SQL and try again the Filter?



For example when I search on my own instance for Name starts with "Action T" the following SQL is triggered:



04:44:28.982: Time: 0:00:00.001 for: empspanaite_2[glide.26] SELECT ... FROM cmdb cmdb0 WHERE cmdb0.`sys_class_path` LIKE '/!!/##%' AND cmdb0.`name` LIKE 'Action T%' /*...*/



I am curios if you get a similar query. And of course, you can compare it between the 2 instances.