List Collector: User Added via Script Only Shows in Selected, Not in Available (No Reference Qualifi

DevYadav
Tera Contributor

Hi everyone, I’m trying to add a user to a list collector field using a Business Rule. I used the script below, and it adds the user correctly to the selected section, but the user doesn’t show up in the available section. I also checked by reverse engineering a working example where the same kind of script was used, and there too, users only appeared in the selected list, not in available. The reference qualifier of the field is empty, but still only 42 users show in the available list, even though there are 1192 users in total. I want the added user to also show in the available list. Can someone please tell me what I’m missing?

(function executeRule(current, previous /*null when async*/) {

var gList = current.u_xyz_abc123 || ""; // dummy field name for list collector

var userSysId = "b3250726dbe47430563afd0e0f961905"; // user sys_id to add
if (gList.includes(userSysId)) {
// Already in list, skip
return;
}

if (gList !== "") {
gList += "," + userSysId;
} else {
gList = userSysId;
}

current.u_xyz_abc123 = gList;

})(current, previous);


Thanks

1 REPLY 1

debendudas
Mega Sage

Hi @DevYadav ,

If your list collector field is extending from a parent table, then check if any dictionary overrides have been written for your table which might cause this issue.

 

If this solution helps you then, mark it as accepted solution ✔️ and give thumbs up 👍