- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 06:51 AM
Hi All,
I want to query the child value based on parent value in table cmdb_rel_ci
How can this be done
Thanks,
Abhi
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 12:20 PM
Thanks. I didn't see that you changed the childList.push() line. You cannot dot-walk inside a getValue() call. IN your case, use this.
childList.push(rel.child.name);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 06:55 AM
Hi Abhi,
It would look something like this:
var parentId = 'some sys_id of a CI';
var childList = [];
var rel = new GlideRecord('cmdb_rel_ci');
rel.addQuery('parent', parentId);
rel.query();
while (rel.next()) {
childList.push(rel.getValue('child'));
}
// Now you have an array of sys_ids of the child records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 06:58 AM
can i write this under script include

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 07:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 07:04 AM
but the childLIST is an array , now how can this be passed to the client side