Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

clear list collector values based on another field

abed123
Tera Contributor

Hi All,

I have a requirement , we have two list collector fields , field1 and field2. field2 is depends on field1, example if field1 is having a,b,c . 1,2,3 depends on a, 1,2 depends on b, if i select 'a' in field1, in field2 i need to get only 1,2,3 if i select a,b in field1 , i need to get records 1,2,3,1,2(not populate we can select from the list)this is completed but in field1 if i remove 'a' , in field2 1,2,3 should be clear remaining 1,2 should be there in the field2(because 1,2 depends on field2). could anyone please help on this.

 

Thanks in Advance!

1 REPLY 1

Brian Lancaster
Kilo Patron

Here are two guru articles. It was a little hard to figure out what you wanted the first once sets a filter on a list collector and the second one allows you to remove items from the selected column.

https://servicenowguru.com/client-scripts-scripting_changing-filter-list-collector-variable-client-s...

https://servicenowguru.com/client-scripts-scripting_move-list-collector-options/