Cat Client Script Support

GMoon
Kilo Sage

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.

1 ACCEPTED SOLUTION

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.

View solution in original post

13 REPLIES 13

Ankur Bawiskar
Tera Patron
Tera Patron

@GMoon 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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.

@GMoon 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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