Combine or concatenate the values of lists together

Prev Next

Overview

In the Form Builder, you're able to concatenate (add) the values of two lists. This can be helpful for calculating the total price, quantity, hours, mileage, or any other value of the selected items of two lists.  

How to add the values of two lists

If you would like to combine the selected values from two Lists fields, you can use the following script as a template. The below script will need to be placed within the formula of a Calculation field:  *Note: You will need to replace the items in red with your field keys.

var allList = $listpicker_1$ + ',' + $listpicker_2$ + ',' + $listpicker_3$ + ',' + $listpicker_4$ + ',' + $listpicker_5$;
var arr = allList.split(',');
arr = arr.filter(cleanArray);
var end = '';
for (i = 0; i < arr.length; i++) {
end += arr[i] + '\r\n';
}
return end;
function cleanArray(item) {
return item != '';
}