- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 04:28 AM - edited 03-28-2025 04:32 AM
Hi all,
I am looking for some support in order to correctly filter a Catalog Item's variables via a Cat Client Script. For example, if I select Production as a value in the Environment variable, I only want Production values to show within the Application Services variable.
The Environment variable is a Multi Choice field, with two values 'Production' and 'Non Production'.
The Application Service variable is a Reference field on the 'cmdb_ci_auto' table, which pulls in various Application Services, they also have values in this table to show whether they are 'Production' or 'Non Production'.
I am having challenges with correct syntax usage and whether I need to glide to the Application Service table. Can someone point me in the right direction please?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 04:59 AM
To filter the list of possible selections in a reference variable, use a reference qualifier on the Application Services variable, not a Catalog Client Script. To incorporate the value of another variable, it would look something like this:
Where 'used_for' is the name of the field on the referenced table that contains the 'Production' or 'Non Production' value, and 'v_environment' is the name of the Catalog Item variable where that value (which must match exactly) was selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 05:11 AM
@Gem Edwards - Say your Environment variable is having Production and Non-Production as choices
second variable is referenced to table cmdb_ci_service_auto where you wanted to apply filter based on the variable envronment then set the referent qualifier in the Application Service as given below,
javascript: current.variables.environment == 'production' ? "environment=Production" : "environment!=Production";
above configuration filters the cmdb_ci_service_auto table values based on the environment.
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 07:32 AM
Thank you Vasanth for the detailed response.
I tested your solution out but unfortunately it is now only showing Non Production values against the Application Services field.