Table column filter based on other column

Hello,
I am trying to create a new column in a table, where I would like to use a Mapped Value javascript to filter the result of another query (FullProducerList) to find out if a column in the table (Title) includes a value from the query.

I have tried like this
{{ FullProducerList.data.Name.filter(item => item.toLowerCase().includes(currentSourceRow.Title.toLowerCase())) }}

The Title column is set as the Source for the column that I am trying to populate.
I am getting blank values for all rows in the table, even tough I can see that there are matches between the array and the Title field in some rows.

The array have e.g. ["AA", "BB", "CC"] and the title column have a field with the content "This row should match AA"

Thank you in advance for your assistance.

Hi @Flemming_Troelsen,

I tested with demo data and it works well. The fix was to check if currentSourceRow.Title includes the item (case-insensitive) and use find to return a single match instead of an array. Make sure the data types are correct.

{{ 
  FullProducerList.data.Name.find(item => 
    currentSourceRow.Title.toLowerCase().includes(item.toLowerCase())
  ) || ''
}}

1 Like