- 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 07:07 AM
What are you looking to do with it on the client side? You may need to adapt the above code as a list of sys_ids typically isn't very useful to a client script.
Docs: Client Scripts
Docs: GlideForm
Docs: GlideAjax
Client Script Best Practices - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 07:12 AM
i am basically trying to get those childs and pass on to the client script and fnally to separate those using for loop in client side

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 07:15 AM
Thank you. It really doesn't matter what you return. If you want to return the array of sys_ids, have your script include gather them up like the above script and then do something like this:
return childList.join(',');
The client script can then parse out the 'answer' (as in the GlideAjax sample script) and then use a standard JavaScript split() operator to turn it back from a comma separated list to an array.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 07:29 AM
Hi chuck,
I am not getting the sysid when returned

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 07:31 AM
Hi Abhi,
I don't have much information to go on. Please describe the business requirement here and share the client script and script include you have so I can get a better context of what you are trying to do.
Thank you