# Concat Multiple Checkboxes While Filtering Duplicates

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

Source: https://tadabase.com/docs/snippets/concat-multiple-checkboxes-while-filtering-duplicates  
Status: Not yet re-checked. 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”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665634733987.png)

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”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665635851688.png)

**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.**

```
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”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665636141425.png)

**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”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665636464608.png)

**Original Community Post:**

[Concatenation of multiple selections (checkboxes) while filtering duplicates - Community Discussions / How Do I - Tadabase Community](https://community.tadabase.io/t/concatenation-of-multiple-selections-checkboxes-while-filtering-duplicates/1396)
