- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2021 10:35 PM
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!
ServiceNow Community Rising Star 2022/2023
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2021 06:30 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2021 06:20 AM
Changing that didn't work but i have used below reference qualifier to get the correct names.
javascript:'parent.sys_class_name=cmdb_ci_db_mssql_instance^'+'child.sys_class_name=cmdb_ci_db_mssql_database^'
Now the only thing i need in this filter is that the field "Parent" should be equal to "MSSQL Instance". I am not sure how i can add this condition here.
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2021 06:30 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2021 09:13 PM
We did it! There is no need to set ref_qual_elements=mssql_instance because the field is on service catalog.
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2021 09:21 PM
Glad to know.
Please mark appropriate response helpful as well.
Please share the final variable configuration screenshot so that it helps future readers
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader