Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Paste multiple comma separated values into a list collector field.

RajuBhai3
Tera Contributor

I have a need to paste values with comma separated values into a filed to be selected in list collector field. I'm trying to achieve to via client script below but getting error below. 

 

function onChange(control, oldValue, newValue, isLoading) {
        // name_of_dl in the field which  I will be pasting comma separated values.
        if (isLoading || newValue == '') {
            return;
        }
        var input = g_form.getValue('name_of_dl');
        var test = input.split(',');
        var emailArray = [];
        for(i = 0; i < test.length; i++) {
            var ShareUsers = new GlideRecord('u_o365_distribution_lists');
            ShareUsers.addQuery('u_email', test[i].trim());
            ShareUsers.query();
            if (ShareUsers.next()) {
                emailArray.push(ShareUsers.u_email.toString());
            }
        }
        g_form.setValue('name_of_dl', emailArray);

}

 

0 REPLIES 0