Concat Multiple Checkboxes While Filtering Duplicates

This is a solution to find only the unique checkbox choices with the custom JavaScript pipe.

  • Not yet re-checked
  • Classic builder

Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

Screenshot for “Concat Multiple Checkboxes While Filtering Duplicates”

This is a solution to find only the unique checkbox choices with the custom JavaScript pipe.

Step 1

Install the Custom JavaScript pipe, and add the parameters as shown in the image below. Feel free to add more values or remove them.

Screenshot for “Concat Multiple Checkboxes While Filtering Duplicates”

Step 2

In the Request tab of the pipe, add the following code. If you added or removed values in step 1, change the values in the request here.

Text
Array.prototype.contains = function(v) {
    for (var i = 0; i < this.length; i++) {
        if (this[i] === v) return true;
    }
    return false;
};

Array.prototype.unique = function() {
    var arr = [];
    for (var i = 0; i < this.length; i++) {
        if (!arr.contains(this[i])) {
            arr.push(this[i]);
        }
    }
    return arr;
}

var concatAll = "{value1}" + ',' + "{value2}" + ',' + "{value3}" + ',' + "{value4}" + ',' + "{value5}";
var duplicatesArray = concatAll.split(',');

var uniques = duplicatesArray.unique();
uniques.toString().replace(/,/g, ", ");
Screenshot for “Concat Multiple Checkboxes While Filtering Duplicates”

Step 3

Configure the pipe in your table rules to run when the record is created or edited, as seen in the image below.

Screenshot for “Concat Multiple Checkboxes While Filtering Duplicates”

Original Community Post:

Concatenation of multiple selections (checkboxes) while filtering duplicates - Community Discussions / How Do I - Tadabase Community

Was this page helpful?

Something wrong or missing on this page? Tell us.