What is the glide.invalid_query.returns_no_rows
System Property?
The glide.invalid_query.returns_no_rows
system property in ServiceNow manages the response of GlideRecord queries when the query is invalid, for example, if it contains incorrect column names.
When set to true, invalid queries will return no records.. The default setting is false.
Why is this an issue?
In GlideRecord, if an invalid query is passed to the query methods, it can result in the entire table being queried, rather than a specific subset of records.
This happens because the invalid portion of the query condition is dropped and the results are based on the valid part of the query, which may return all records from the table. Care should be taken when using methods like insert()
, update()
, deleteRecord()
or deleteMultiple()
on these bad query results as it can result in data loss.
How do I fix it?
To fix this issue, set the value of the glide.invalid_query.returns_no_rows
to true:
In the Filter Navigator, type and enter sys_properties.list.
In the Name field, search for
glide.invalid_query.returns_no_rows
.Change the Value field to true.
If you search for glide.invalid_query.returns_no_rows
and no results are found, it means you will need to create the property:
In the Filter Navigator, type and enter sys_properties.list.
On the list, click on New to create a new property.
Populate the fields accordingly:
Name:
glide.invalid_query.returns_no_rows
.Type: true | false.
Value: true.
- Submit the new system property.