Populate users with comma separated in a String field

Lucky1
Tera Guru

Hi folks,

on the request form, there are 2 fields, "Requester" which is of type reference and "Users List" which is of type String. When i select a user in the requester then in the Users List field, his user ID should populate and the Requester field should get cleared. Another time if you select other user, then the Users List field should populate with that value too with comma separated. 

Note: The user which we have already selected should not populate again when we try to select him again. It should give alert like "you have already selected the user"

 

So for my above query, i am showing an example here:

If i select Abel Tuter in Requester field, then the Users List field should populate with Abel.Tuter, Now if you select Dean james then the Users List field should look like Abel.Tuter,Dean.Jones

Like this the Requester field should be cleared and the selected users should populate in the Users List field with comma separated. No duplicates should come. 

I tried with get Reference method, and i am able to populate Users List field with only one value. I think we have to use for loop and an array to store those selected values. 

Can some one please give me code for this above task

 

 

regards,

Lucky

18 REPLIES 18

Jaspal Singh
Mega Patron
Mega Patron

Hi Lucky,

 

Can you share the script that you used once for a check.

Kieran Anson
Kilo Patron

Hi,

Is there a reason for this approach rather than a list collector?

Hi Kieran, I think there is no option for setting up list collector field type on Request form. List collector can be used as a variable in catalog items. Regards, Lucky

Hi Luckym

Can you try list data type? This can be configured on Request form.

Thank you,

Palani

Thank you,
Palani