Lookup Select Box reference qualifier help

Ramanjaneyulu
Tera Contributor

I have two OOB tables: cmdb_ci_service and cmdb_rel_ci

I have two variables on the catalog item form:
1) App ( lookup select box ) variable with cmdb_ci_service table reference.

2) server ( lookup select box ) variable with cmdb_rel_ci table reference

My goal is to make it such that when an "Application" is chosen then display only the CHILD with a ref qualifier on the PARENT that should be equal to the output of variable "Application"

Example: I have 4 records creation with "Blackberry" application
So, I if select Application as "Blackberry" then I need to display below list records in the second variable ( server ( lookup select box ).

Please help with this task.
I have tried with below code but, it's not working for me

"Application" variable:

Variable: - application
Question: - Application
Name: - application
Type: Lookup Select Box
order: - 200
Lookup from table: cmdb_ci_service
Lookup value field: name
Lookup label field(s):
Include none: true
Reference qualifier: service_classification=Business Service
Variable attributes:

Variable "Server" :
Variable: - server
Question: - Server
Name: - server
Type: Lookup Select Box
order: - 200
Lookup from table: cmdb_rel_ ci
Lookup value field: parent
Lookup label field(s):
Include none: true
Reference qualifier: javascript:'parent=' + current.variables.application
Variable attributes: ref_qual_elements=application


1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

You're close!

So you'd want to change your reference qualifier on the cmdb_rel_ci referenced variable to:

javascript:"parent.name="+current.variables.application;

Since you chose the value in the first variable to use it's "name", you must then search in the variable by the name (else normally it's "Sys ID").

Secondly, you'd want to consider using "child" as the label maybe for the second variable else "parent" shows up as the selections and I'm sure you want to see the child name's there instead.

End result example:

find_real_file.png

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

6 REPLIES 6

Allen Andreas
Administrator
Administrator

Hi,

You're close!

So you'd want to change your reference qualifier on the cmdb_rel_ci referenced variable to:

javascript:"parent.name="+current.variables.application;

Since you chose the value in the first variable to use it's "name", you must then search in the variable by the name (else normally it's "Sys ID").

Secondly, you'd want to consider using "child" as the label maybe for the second variable else "parent" shows up as the selections and I'm sure you want to see the child name's there instead.

End result example:

find_real_file.png

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

also, help me on how to add extra filter condition in the second variable ..?

Ex: javascript:'parent.name=child.u_source=microfocus' + current.variables.application

It's not working for me

 and I have selected 

"Lookup value field: child "

rahulpandey
Kilo Sage

You need to update the reference qualifier for server variable as below

javascript:'parent.name=' + current.variables.application

Ramanjaneyulu
Tera Contributor

also, help me on how to add extra filter condition in the second variable ..?

Ex: javascript:'parent.name=child.u_source=microfocus' + current.variables.application

It's not working for me

 and I have selected 

"Lookup value field: child "