copy list collector Values to multiline text

Ak8977
Tera Expert

I have a variable of list collector type  referring to user table. I need to copy the user names of that variable to another multiline text variable.

2 REPLIES 2

Anirudh Pathak
Mega Sage

Hi @Ak8977,

I've written this code assuming you want it on server side, change the syntax accordingly if you want it on client side.

For Client side use GlideAjax to get the username. But the logic remains the same for getting the username.

Try this code -

 

var list = current.fieldName// your list collector field name

var arr = list.split(',');

var str = '';

for(var i = 0; i < arr.length;i++) {

var user = new GlideRecord('sys_user');

if(user.get(arr[i])) {

str = str + user.name + " ";

}

}

current.multilineFieldName = str; // your multiline text field name