Removing empty values from mapper in select

Hello All!

Im importing values from a column of a spreadsheet. Some of the cells are blank and I would like to remove them so I don't have a blank option in my select:

I have tried to just a git of JS to remove it:

Object.keys(item.Product).forEach(key => {
  if (item.Product[key] === '') {
    delete item.Product[key];
  }
});
 item.Product }}

but it gives me "undefined":
image

Any clue?

Many thanks

Maybe you would want to check that if it is NOT empty then add it to the Select...

1 Like

Maybe that would work. Not sure why this one is not working.
Anyways I have created a transformer and using this instead.

var products = {{getTrades.data}}
products = products.map(x => x.Product)
products = [...new Set(products)]
products = products.filter(x => x)
return products

duplicates and blanks removed.

Many thanks

1 Like