Reference Qualifier Multiple Conditions

booher04
Tera Guru

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;

4 REPLIES 4

palanikumar
Giga Sage

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

Thank you,
Palani

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.

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

Thank you,
Palani

Hi @palanikumar can you help me for this question https://community.servicenow.com/community?id=community_question&sys_id=b57e29dbdbdc09102454e6be13961943