List Collector Dependency

kambleneeta20
Giga Expert

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.

1 ACCEPTED SOLUTION

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

Thank you,
Palani

View solution in original post

9 REPLIES 9

palanikumar
Mega Sage

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

Thank you,
Palani

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 ?

 

 

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?

Thank you,
Palani

 

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 ?