Did not get meaning of sys_IDIN,can anyone explain?

manali harmalka
Kilo Guru

I am using javascript:'sys_idIN' + new CIUtils().servicesAffectedByCI(current.cmdb_ci) ,into reference qualifier to call OOTB script include but did not get meaning of "sys_IDIN". can anyone answer? Thank You in advance

1 ACCEPTED SOLUTION

darius_koohmare
ServiceNow Employee
ServiceNow Employee

At a high level, what you are doing is creating a dynamic reference qualifier that you are building with that javascript.

sy_idIN is the query that checks the current sys ID and sees if it is IN the following array. That array comes from:

new CIUtils().servicesAffectedByCI(current.cmdb_ci) -> This returns a array of all the sys IDs of CI's affects by the passed in current.cmdb_ci. https://docs.servicenow.com/bundle/kingston-application-development/page/app-store/dev_portal/API_reference/CIUtils/concept/c_CIUtilsAPI.html 

 

 

View solution in original post

4 REPLIES 4

Anurag Tripathi
Mega Patron
Mega Patron

sys_IDIN evaluates to sys_id is one of 'sys_id 1, sys_id 2, sys_id 3'

-Anurag

darius_koohmare
ServiceNow Employee
ServiceNow Employee

At a high level, what you are doing is creating a dynamic reference qualifier that you are building with that javascript.

sy_idIN is the query that checks the current sys ID and sees if it is IN the following array. That array comes from:

new CIUtils().servicesAffectedByCI(current.cmdb_ci) -> This returns a array of all the sys IDs of CI's affects by the passed in current.cmdb_ci. https://docs.servicenow.com/bundle/kingston-application-development/page/app-store/dev_portal/API_reference/CIUtils/concept/c_CIUtilsAPI.html 

 

 

Thank u for sharing information,shared link is very helpful

Abdul Khan4
Kilo Guru

IN is Query String operator. Other examples of operator ...

(must be in upper case):
  • =
  • !=
  • IN
  • NOT IN
  • STARTSWITH
  • ENDSWITH
  • CONTAINS
  • DOES NOT CONTAIN
  • INSTANCEOF

 Example 

var gr = new GlideRecord('incident');
gr.addQuery('number','IN','INC00001,INC00002');
gr.query();
while(gr.next()) {
  //do something....
}