Goran WitchDoc
ServiceNow Employee
In this video I show what the system property "glide.invalid_query.returns_no_rows" does and why you should have it set as true on your instance. Another valid point that I forgot to mention. IF you have a custom field in a condition builder and the field gets deleted. This property will also throwback 0 records there, showing that there is something wrong.
1 Comment
Mikael Karlsson
Mega Sage

Fantastic setting, had it on for several years but also a bit scary that this is not the default behaviour.


Unfortunately the adoption seems very low and not in the cross-testing done before releasing new features. The recent version of Platform Analytics becomes unusable since it likely has bugs and calls invalid queries for each table access making all visualizations show "No data available". We have been forced to disable this setting again after two weeks of not getting anywhere with support, no rollback ability, backporting fixes to Zurich was perhaps being considered by the devs but who knows how long it will take.

 

We were however reassured that having the setting off was safe 😉 :
Query to developer: Is this fine to make false?
Yes, as per the description only case of invalid field it fails when it is true

If you dont have the setting turned on, feel free to try this example cleanup script which in this case only prints, if there is an unexpected surprise then perhaps configure the setting! 🙂

var grUser = new GlideRecord('sys_user');
grUser.addQuery('mail', 'CONTAINS', '@protonmail.com');
grUser.query();
while (grUser.next()) {
	gs.info('This would have deleted ' + grUser.getDisplayValue());
}