How to populate CI'S parent Class and Child classes in custom table CMDB

taylor13
Tera Contributor

Hello Team,

I'm New to ServiceNow. I have created 3 fields one is reference to cmdb_ci table and based on selected CI I want to Populate all parent CI and Child CI two different Fields and both are List collector field. can any one help me.

 

@anillande

@ankurbawiskar

7 REPLIES 7

Hi @taylor13 ,

 

In general, there can be more than one parent CI and one child CI, so i guess you would like to have populated all related CIs to those list collectors you have made? Or do you only need to have populated one specific? 

 

2nd, if you only would like to have populated one, why have you created list collector fields and not reference fields which directly referencing the specified CI table? 

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Actually I have created List collector fields only,as per based on Selected CI need all parent CI and Child CI .

can you help me with the scripting part?

This is not how to define relationships between CIs.  In general CIs do not actually have a parent-child relationship, per se.  Rather, relationships are stored in a separate table called CI Relationship (cmdb_rel_ci).  Each CI Relationship record has a Parent CI, a Child CI, and a Descriptor that specifies the semantic relationship from one CI to the other CI (e.g. "Runs :: Runs on" or "Depends on :: Used by").  Make sure you have taken ServiceNow Fundamentals training before deciding to customize your ServiceNow instance.

 


The opinions expressed here are the opinions of the author, and are not endorsed by ServiceNow or any other employer, company, or entity.