lookup select box showing only sysid

JagjeetSingh
Kilo Sage
Kilo Sage

Hi,

I have a field "MSSQL Instance" which is referring table "cmdb_ci_db_mssql_instance" table.

And there is another field "database" where i need to populate all databases running on the particular instance name selected in "MSSQL instance" field as above.

to achieve this i am setting my second field "database" as lookup select box and referring the table "cmdb_rel_ci" and in lookup value field i am choosing "Child". The idea is to set the reference qualifier to match the parent with MSSQL instance field and then show relevant child values.

I am stuck at both the steps. In database fields i am not getting correct values. It is showing only sysIDs.

Also below is my reference qualifier which doesn't seems to work.

javascript:'parent=' + current.variables.mssql_instance

help!

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023
1 ACCEPTED SOLUTION

Hi,

something like this

javascript:'parent.sys_class_name=cmdb_ci_db_mssql_instance^' + 'child.sys_class_name=cmdb_ci_db_mssql_database^' + 'parent=' + current.variables.mssql_instance;

Also in the variable attributes of the lookup select box add this

ref_qual_elements=mssql_instance

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Did you set the variable attributes for the lookup select box

ref_qual_elements=mssql_instance

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@Jagjeet Singh 

please share your lookup select box variable configuration

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

find_real_file.png

 

This is my configuration Ankur. For now i am not even able to populate the child values in field. Getting SysID's there. I am using this in catalog item.

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023

Hi,

the table "cmdb_rel_ci" doesn't have display=true for any of the field

Can you try to set the Lookup label field as Child for that lookup select box variable

I could see it is empty

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader