- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2020 02:28 AM
Guys , I have one list collector variable named 'user' which is referred to sys_user table . Now requirement is to show count of users selected in one variable named 'count' which is a simple text field.. Please help
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2020 02:48 AM
Yes you can.
Try below as an onChange() client script that runs when list collector field has values added.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var checkcount = g_form.getValue('listcollectorvriablename');
var len = checkcount.split(',').length;
alert('Length is ' + len);
g_form.setValue('yourcountfield', len);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2020 02:39 AM
Hi,
You can write a code as below in BR if it has to happen in background.
var listC = current.fieldnameoflistcollector;
var spl = listC.split(',');
current.countfieldname = spl.length;
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2020 02:43 AM
Thanks Ashutosh . is there any way to do it via client script ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2020 02:48 AM
Yes you can.
Try below as an onChange() client script that runs when list collector field has values added.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var checkcount = g_form.getValue('listcollectorvriablename');
var len = checkcount.split(',').length;
alert('Length is ' + len);
g_form.setValue('yourcountfield', len);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 12:35 PM
Hi,
The solution you proposed is working perfectly.
But one query, the value is coming up in the decimal. how can we change that.
Any suggestions please.
Regards,
Vinod.