- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 06:13 AM
Hi,
I am trying to populate the results in list collector variable based on the value selected from another variable.
I have variable A (selectbox) and variable B(list collector). When I select any option from variable A for eg. "x1" then variable B referencing a customized table having a field u_description which will filter u_description contains "read" keyword and u_description contains "x1". Based on the condition, it will display the one or multiple results from the table in the varible B.
I am using a script include and client script for this requirement and it is not working. Can somebody help on this.
Script Include :
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 01:54 AM
you need to do 2 things which I mentioned in my 1st response to your question
1) advanced ref qualifier
a) why variable value will be random? You said it's a select box so it should have choices in it, you can use that.
You can use this, for x1 choice value you can have a query
javascript:var variableValue = current.variables.please_select_the_fileserver_where_the_shared_folder_is_located.toString() ; var query; if(variableValue == 'x1') query = 'u_descriptionLIKEread^u_descriptionLIKE' + variableValue; query;
If you want the same filter for other drop down choices then do this generic
javascript:var variableValue = current.variables.please_select_the_fileserver_where_the_shared_folder_is_located.toString() ; var query = 'u_descriptionLIKEread^u_descriptionLIKE' + variableValue; query;
2) variable attributes - add this
ref_qual_elements=please_select_the_fileserver_where_the_shared_folder_is_located
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 03:24 AM
please update : in your ref qualifier.
Community converts : to :
share the choices for your select box?
Also share if there are records matching in your table with that filter condition?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 01:40 AM - edited 07-01-2025 01:43 AM
Hi Ankur,
Thanks for your response.
I have added glide_list in the attributes.
I have tried below:
What should be the value in place of x1 ? It will a random one from the variable. Do i need to store the select box variable value in a variable and use that ?
javascript: var query; if(current.variables.please_select_the_fileserver_where_the_shared_folder_is_located == ? ) query = 'u_descriptionLIKEread^u_descriptionLIKE?'; query;
Thanks for your support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 01:54 AM
you need to do 2 things which I mentioned in my 1st response to your question
1) advanced ref qualifier
a) why variable value will be random? You said it's a select box so it should have choices in it, you can use that.
You can use this, for x1 choice value you can have a query
javascript:var variableValue = current.variables.please_select_the_fileserver_where_the_shared_folder_is_located.toString() ; var query; if(variableValue == 'x1') query = 'u_descriptionLIKEread^u_descriptionLIKE' + variableValue; query;
If you want the same filter for other drop down choices then do this generic
javascript:var variableValue = current.variables.please_select_the_fileserver_where_the_shared_folder_is_located.toString() ; var query = 'u_descriptionLIKEread^u_descriptionLIKE' + variableValue; query;
2) variable attributes - add this
ref_qual_elements=please_select_the_fileserver_where_the_shared_folder_is_located
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 03:10 AM
Hi Ankur,
I have implemented this and it is not working. showing all the values.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 03:24 AM
please update : in your ref qualifier.
Community converts : to :
share the choices for your select box?
Also share if there are records matching in your table with that filter condition?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 04:07 AM - edited 07-01-2025 04:09 AM
Hey Ankur,
It is working now after updating " : " :).
can i use glide_list and bo_filter on variable attributes ? or not required ? if i use this will it be comma separated ?
Thank You So Much for your help and patience.
