Reference Qualifier Multiple Conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2021 09:25 AM
I have a reference field(application_name) for the cmdb_ci_business table on my catalog item. There is a field on that table called "u_environment". I have a field on the Catalog Item called "environment". My goal is to look at that environment field on the item and then filter the "application_name" reference based on if "environment" Production or not. What i have in place so far is working for if the field is Production, but I need a second filter to be if it's not production it shows the choices in the table for field "u_environment" that are not "production". The last part is that it also needs to filter u_related_business_app.u_company(from the table) to match the catalog item field "chg_company_var". Any ideas on how to get the 2nd part where the environment is not Production to show all choices that are not production? Here's what I have so far.
javascript:'u_environment='+current.variables.environment+'^u_related_business_app.u_company=current.variables.chg_company_var;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2021 09:45 AM
Hi,
You didn't create your query correctly. single quotes and + is missing in this. You can use the below query
javascript:'u_environment='+current.variables.environment+'^u_related_business_app.u_company='+current.variables.chg_company_var;
Thank you,
Palani
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2021 09:48 AM
Thank you but that doesn't help my need. Here's a little more info:
Filter the Application Name (application_name) variable to show Business Services based on the conditions below.
- If "environment" is set to "production" only show business services where "environment" is "production".
- If "environment" is set to "non-production" only show business services where "environment" is not "production".
AND
Only show business services whose "u_related_business_app.u_company" field contains the same value entered in the "chg_company_var" variable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2021 09:58 AM
Then your condition should be:
javascript:((current.variables.environment=='Production')?'u_environment=Production':'u_environment!=Production')+'^u_related_business_app.u_company='+current.variables.chg_company_var;
I assume environment is string field. If it is reference then replace text Production with sys_id of production record
Thank you,
Palani
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2021 10:45 PM
Hi