We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

database view OR condition

Dante Ditan
Kilo Sage

Hello,

Can anyone tried to add OR condition in the where clause in database view?

(cat_u_category =inc_category && ( cat_u_subcategory =   '' OR   inc_subcategory = '' ) )

I have tried this but it is not working. when I removed the OR and replaced by && it is working.

Thank you

3 REPLIES 3

Patrick Schult2
Giga Guru

Try using the JS-style " || " operator instead of "OR".


I tried this cat_u_category =inc_category && cat_u_subcategory = '' and it is not getting the records tho.


Patrick I think the || will work. But trying this query cat_u_category =inc_category && cat_u_subcategory = '' this is not working I guess that null field values is not grabbing into the database view.,