How to combine 2 array fields?

Zod
Giga Guru

Hi,

for a string I can do something like this ... current.u_field1 =   current.u_field1 + current.u_field2; current.update();

... but how to do this if both fields are arrays?

Thank you!

1 ACCEPTED SOLUTION

Have a read of this thread about why not to use current.update()



Never use current.update in a Business Rule



try the below script, it's saying, if the current watch list is not empty, get the value and add it to the work notes.



if(!current.watch_list.nil()){


var watch = current.getValue('watch_list');


current.work_notes_list += ',' + watch;


}


View solution in original post

16 REPLIES 16

Dubz
Mega Sage

Hi Vemffm,



What sort of fields are you working with? Array isn't a field type, are you working with list (glide list) fields?


Sorry. Yes. List.


OK so there's a handy script include on Chuck Tomasi's blog which can be used for interacting with glide list fields, you can get that at the link below.



Managing Glide Lists


ok thanks - so no easy way ;-(



Why simple things are so non-simple from time to time? 😉