- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 06:21 PM
I wonder if anyone can assist.
I have a catalog question that lists items from cmdb_ci_kubernetes_namespace table. But I want to restrict the items shown in the drop down box to just those records where the u_service column has value matching a service in another table.
I'm open to suggestions how to do this but the way I went was to create a script include that returns an array of service names in the other table. A client onLoad script calls the script include, putting the resulting array in a hidden question/variable (defined as one line text).
In the catalog variable I have the following type specifications:
But this still returns the complete list of items in the Kubernetes Namespace table, not just those that exist in the array. I see no errors on the Javascript console. The returned array has the correct values and is stored in a text variable as stringified JSON.
Any ideas on how to make this work?
Thanks
Ron
Thanks
Ron
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 11:04 PM
Do your calculations in the script include. Following logic:
- In the script include make a glide record to your table, filtering based on the other table.
- Put the sys_id's in an aray and return this array
- In the reference qualifier make a simple query: sys_id IS ONE OF 'your array"
- this will try to find only the records, which have their sys_id in the array, returned by the script include.
hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 11:04 PM
Do your calculations in the script include. Following logic:
- In the script include make a glide record to your table, filtering based on the other table.
- Put the sys_id's in an aray and return this array
- In the reference qualifier make a simple query: sys_id IS ONE OF 'your array"
- this will try to find only the records, which have their sys_id in the array, returned by the script include.
hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 11:07 PM
Thanks Martin, sounds like the way to go. I found documentation on advanced reference qualifiers which appears to be the solution you propose. Will let you know how I get on.
Thanks
Ron