sysparm_query #233
-
Hello - I have been using the servicenow.itsm collection for over a year now mainly for the cmdb inventory plugin. I see we can now use sysparm_query to build our filter but I am having trouble with getting my test_now.yml to actually query the databse, it brings every in every entry from the table i target. I tried to find some examples from the now.yml documentation here but coming up short. any help appreciated.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi! Most probable case is that any field name is wrong. I usually test it by adding params one by one and seeing when response get longer (filter not working any more). If I copy/paste your query to my system i get no filtering at all (40 elements). But If I use only I agree that this behavior is not as expected - but it is how ServiceNow returns values. Our inventory plugin more or less calls next API. We only add param
So you can test your query there. If it works there it should also in inventory plugin. |
Beta Was this translation helpful? Give feedback.
Hi!
Most probable case is that any field name is wrong. I usually test it by adding params one by one and seeing when response get longer (filter not working any more).
If I copy/paste your query to my system i get no filtering at all (40 elements). But If I use only
sys_class_name=cmdb_ci_win_server
I get back 8. But you used names1_sys_class_name
which does not exist on my instance - so I got full result back.I agree that this behavior is not as expected - but it is how ServiceNow returns values.
Our inventory plugin more or less calls next API. We only add param
sysparm_display_value=true
.