How to add previous value and current value without erasing the previous value in list collector var

Vamsi Krishna
Tera Contributor

Hi All,

 

I got an requirement like there are two fields  network which is basically multi choice having choice values like ab1,ab2,ab3,ab4 and another field business which is reference from department table which is list collector variable we can add multiple values in that. I have written one code if network value is "ab1" then business field should update like "cus1" and if someone changes the network to "ab2" then business field should show previous value like "cus1" along with new value "cus2". 

 

The code I written is not working as expected whenever network values change business field previous value is getting override with new value , suppose if i change from "ab1" to "ab2" then business field only showing new populated value it is not showing previous value along with new value. can you please help me out.

VamsiKrishna_0-1707794411664.png

 

 

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

If 'department' is the name of the list field, then use current.department += ',' + 'super secret value'); to append the new value to the existing value.  A list field stores as its value a comma-separated list of sys_ids.