How to turn the dropdown values into unique values

Hi, I am trying to solve a simple issue. I am pulling the data from Google Sheets, which was listed as "USA, Canada, UK". Then, I tried to use item.split(", ") so it can be displayed as Tags in the table. However, another extra work seems to be done in the dropdown as it is reading the original data, and it wasn't returning the data broken by comma, but the whole unique array. Is there a better way to turn it into the expected result (as shown below)?


I tried to solve this by adding an extra query after it pulls the data successfully, so it can return a single unique value

let data = [];
let deliveryTeams = [];

for (let item of {

deliveryTeams = deliveryTeams.join().split(",");

function removeDuplicates(deliveryTeams) {
    let unique = [];
    deliveryTeams.forEach(element => {
        if (!unique.includes(element.trim()) && element.trim() !== "") {
    return unique;

data = removeDuplicates(deliveryTeams);
return data;


I have multiple columns with the same issue, so many queries are created to solve the issue. Is there a simple way to achieve the same, or how to reuse the query by passing a parameter? Thank you!

Hi @Nikki_Ip,

You could do this a few different way, but the easiest might be a transformer with something like this:

const deliveryTeams = => d.Delivery_Teams)
return _.uniq(deliveryTeams)

Lodash is included by default and you can use it's _.uniq function.

Without Lodash, as a one-liner you could do
[ Set( => d.Delivery_Teams)]

1 Like

Thanks for the input. I tried to use the code above on the Data Source, but it seems doesn't work. Maybe I've missed something...

Then I solved this by adding this code to the Data Source

{{Array.from(new Set( => obj.Delivery_Teams.split(', '))))}}