- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2024 12:50 AM - edited 09-13-2024 12:50 AM
Hi Team,
We have a List collector field and we are trying to populate the Account names which have comma at places, this is treating it as another values and making it split.
How to correct this behaviour
Below is the list of account names with commas
When I try to fetch using OnChange Client script from script include it treats comma as separate as below:
Below is my script and I am trying to comma as string but still it is not working
if (type == 10) {
var add = new GlideRecord('customer_account');
add.addEncodedQuery('account_pathSTARTSWITH' + con_rel.account.account_path + '^account_parentISNOTEMPTY');
add.query();
while (add.next()) {
var addresp = new GlideRecord('sn_customerservice_contact_relationship');
addresp.addQuery('contact', con_rel.sys_id.toString());
addresp.addQuery('company', add.sys_id.toString());
addresp.addQuery('u_authority_role', res);
addresp.query();
if (!addresp.next()) {
accounts = add.name.getDisplayValue();
//gs.info('accounts:'+accounts);
comma_add = accounts.replace(/,/g,',');
gs.info('comma_addis:' + comma_add);
arr.push(comma_add);
Please help?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2024 01:10 AM
@Community Alums Instead of pushing the account names in array, you can choose to push the sys_ids and populate these sys_ids on your list collector using client script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2024 01:10 AM
@Community Alums Instead of pushing the account names in array, you can choose to push the sys_ids and populate these sys_ids on your list collector using client script.