- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 02:33 AM
Hi
I wanted to add a filter condition to a variable in catalog item but there is already an advanced reference qualifier present.
now I want to add this filter condition operational_status=1 along with the present condition.
javascript: current.variables.v_BLine2 == '' ? '': 'u_group='+ current.variables.v_BLine2;(existing condition)
I tried this way but didnt get the result
javascript: current.variables.v_BLine2 == '' ? '': 'u_group='+ current.variables.v_BLine2+"^operational_status=1";
Any suggestions..?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 04:16 AM
Hi,
is your existing ref qualifier working fine?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2020 01:05 AM
HI
The existing Ref Qualifier was of no use so i removed and set from advanced to simple.
Thankyou

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 02:49 AM
Hi,
You cannot use ternery operator in the condition itself. declare a varialbe query and assign the value based on your ternery operator. Try like this.
javascript: var query; if(current.variables.vBLine2 == "your_value") { query = 'u_group='+ current.variables.v_BLine2; } else {query = 'u_group='+ current.variables.v_BLine2+"^operational_status=1";} query;
Mark the comment as correct/helpful if this has helped to solve the problem.