data restrict in list type of variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
In a catalog form i have two variables one is check box other is list collector my requirement is if i select the check box it should populate only few records in listcollector varaible(need to restrict other data) if unchecked it should populate except few
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello @dixitreddy,
Add an Advanced Reference Qualifier to the List Collector.
Let me know if you need more details.
Regards,
Ayan Murshad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
you can use advanced ref qualifier on list collector and use this sample script
Note: ensure you give correct variable name and sysIds for the records you want to show
javascript: var query; if(current.variables.checkBoxVariableName == true) query = 'sys_idINsysId1,sysId2,sysId3'; else query = 'sys_idNOT INsysId1,sysId2,sysId3'; query;
Also ensure in variable attributes of list collector add this
ref_qual_elements=checkBoxVariableName
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
15 hours ago
Hi @Ankur Bawiskar i have tried this javascript: var query; if(current.variables.amer3_jv_les == true) query = 'u_nameINAMER_US_N0498,AMER_US_N0490,AMER_US_N0508,AMER_US_N0511,AMER_US_N0514,AMER_US_N0502,AMER_US_N0499^u_active=true'; else query = ''; query;
in attribute-- ref_qual_elements=amer3_jv_les
but it is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I assume you're data in the list collector is pulling from a table. Have you attempted a reference qualifier based on the true/false from your checkbox?
I believe you can us a catalog client script controls the reference qualifier for your list collector's data.
I found another suggestion for an 'if' statement inside the reference qualifier
I have up
javascript:if(current.variables.chexkbox_value == 'true')'active=true'; else'active=false';
Hopefully this helps