+1 vote
in Service Now by
How will you get all the records where the incident is having category as hardware or software in Servicenow?

2 Answers

0 votes
by

Use addOrCondition(String name, String oper, Object value) .
Example :
var gr = new GlideRecord(‘incident’);
var qc = gr.addQuery(‘category’, ‘hardware’);
qc.addOrCondition(‘category’, ‘software’);
gr.query();

0 votes
by

By default queries with the invalid field, names run but ignore the invalid condition. For more strict query control you can enable the glide.invalid_query.returns_no_rows property which will result in an empty result set for invalid queries.

Related questions

0 votes
asked Oct 9, 2023 in Service Now by john ganales
0 votes
asked Sep 7, 2020 in Service Now by Hodge
...