- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2021 07:43 AM
Hi Experts,
In Catalog item there are 2 List collectors , first for - "In use" Asset and Other for -"Not in Use" ;both are pulling record from same class.
Here requirement is if record is selected in first List Collector then that record should not be visible in second List collector" .
What filter condition should add to achieve it ?
Thank you.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2021 10:24 PM
Your query has some issue. While writing query for this you should remember which is dynamic and write query accordingly. In your string current.variables.asset is a dynamic value rest are static string. So, in your condition you have to concate static string with dynamic value. So, your condition should be as below:
javascript:"sys_idNOT IN"+current.variables.asset + "^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe";
You have to add variable attributes as well. Without variable attributes, other variable does not get refreshed.
Thank you,
Palani
Palani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2021 07:59 AM
Hi,
You can add onchange client script for both list collector with the below details
Type : onchange
Variable : list_collector_1
Script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var myListCollector = g_list.get("list_collector_2");
myListCollector.setQuery('sys_idIN' + newValue);
}
Similarly you can create another client script for other list collector with values swaped
refer this link for reference
https://community.servicenow.com/community?id=community_question&sys_id=1efe7229db58dbc01dcaf3231f961998
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2021 08:40 AM
Hi,
Thanks for your reply.
However my requirement is if one record has already been selected in one List collector , that record should be visible in second list collector.
Above code is not working.
Could you please suggest ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2021 08:46 AM
Hi,
So, if I select a value in List collector 1, then you want the second List collector has the same value selected?
In that case both will have same values always rite?
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2021 09:33 AM
Hi,
Sorry for the Typo mistake , below is corrected one -
If one record has already been selected in one List collector , that record should not be visible in second list collector.
Above code is not working.
Could you please suggest ?