- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:01 AM
Hi all,
I have a requirement on a Catalog Item to populate a field based on a prior selection. I have written a script but cannot get it to function, details below:
Variable name: 'server_to_enable' - this populates a list of configuration items.
Variable name: 'environment_to_enable' - we want this to populate with a list of environments that are associated with the earlier configuration items field. (this is the field that is not populating).
I've attached the script below, thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 03:21 AM
Hello Ankur,
Thanks for the script details. I tested this out but it did not work unfortunately. I believe the script includes method may be the way forward.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:04 AM
Is your 1st variable referring to CI table?
If yes then you can achieve this without scripting using the Auto populate feature of Utah, no scripting required
Auto-populate a variable based on a reference type variable (Utah)
also from your image it's not recommended to use GlideRecord in client script, so you will have to use GlideAjax with script include
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:50 AM
Hi Ankur,
I'm not able to utilise that function as the reference table for the CI does not contain the information related to the environment, I'm not able to dot walk to it via this method unfortunately.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 04:11 AM
the reference variable is referring to which table?
Also environment needs to be fetched from which field of which table?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 06:47 AM
They are both reference fields, as below:
Variable name: 'server_to_enable' - cmdb_ci_server
Variable name: 'environment_to_enable' - cmdb_ci_environment
The environment table is: cmdb_rel_ci
The environment field is: parent