LIST COLLECTOR

servicenow14710
Tera Expert

Hello, can we copy one list collector values to another list collector?If so, how to copy those values.

Any help is highly  appreciated. Thank you!

@BharathChintala :Any Suggestions?

1 ACCEPTED SOLUTION

@servicenow14710  to store available values from 1st list collector? you want selected values or available values?

 

Here is multiple ways you can do: If it in regular table not catalog items

if you want to see changes in form live

1. write onchange client script on list collector 1

BharathChintala_0-1676605508134.png

    var users = g_form.getValue('u_users');
    g_form.setValue('u_users_2', users);
 
If you want perform on server side
2. write before BR
on table you know
insert and update
condition is list filed changes
in advanced
 
current.listfield2 = current.listfield1;
 
don't add anything else like current.update() in BR.
 
If it is catalog item
write onChange catalog client script in item
same above script or onsubmit also work as when submitting move values.
 

 

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

View solution in original post

5 REPLIES 5

BharathChintala
Mega Sage

@servicenow14710 

yes we can. Few questions

 

are both reference list collectors?

or both list collector with choice options?

or 1 each?

 

when copying from one to other will other have already data in it? if there is data want to override it or add it?

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

@BharathChintala :Hello bharath, both are list collectors, one is with values and the other is empty (the second one is just an empty list collector created to store the values available in the first list collector).Thank you!

@servicenow14710  to store available values from 1st list collector? you want selected values or available values?

 

Here is multiple ways you can do: If it in regular table not catalog items

if you want to see changes in form live

1. write onchange client script on list collector 1

BharathChintala_0-1676605508134.png

    var users = g_form.getValue('u_users');
    g_form.setValue('u_users_2', users);
 
If you want perform on server side
2. write before BR
on table you know
insert and update
condition is list filed changes
in advanced
 
current.listfield2 = current.listfield1;
 
don't add anything else like current.update() in BR.
 
If it is catalog item
write onChange catalog client script in item
same above script or onsubmit also work as when submitting move values.
 

 

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

@BharathChintala : i need to store values from one list collector to another, this is for catalog item.Thanks for the solution.