Table column 'Tag' data type and mapped options

Hey Friends! :wave:

I'd be grateful for some assistance with my limited JavaScript knowledge, please.

I have a workflow returning a pandas dataframe where my 'Matches' column returns 3 of the closest matches from a lookup list, against the value in the 'Name' column.

Table1 shows the 'Matches' column as a String data type and so you see 3 suggested matches, with scores, as nested arrays.
I am trying to achieve something like Table2 whereby the 'Matches' column offers the 3 suggested names only as tags for the user to select the most appropriate name.

Here's what I'm trying out for expressions...


result:

or


result (which is almost there!):

Is what I'm trying to achieve doable with mapped options for tags, or am I best off doing the wrangling back in the workflow?

Any pointers greatly appreciated and thanks for dropping by :+1:
Ben

Hi @mrben Unfortunately this isn't currently supported by the Tags or Tag column type. The Tags and Tag column types only allows for a single selection of options that will be available for every row in the table. It's not possible to configure distinct options for each row. BUT, I've let our Engineering team know that you'd like to this capability from Retool and will let you know if they make this change down the road!

For now, my suggestion would be to enable expandable rows on your table component and use a dropdown component in the row expansion. Could that work for your use case?

Here's a lightweight example:

Dummy dataset populating the table

{
  id: [1, 2],
  name: ["B", "F"],
  options: [
    [["A", 1, 2],["B", 3, 4],["C", 5, 6]], 
    [["D", 10, 20],["E", 30, 40],["F", 50, 60]]
  ]
}

Enabled expandable rows on the table

Add a Select component to the expanded row and set the select component Data source with the array from the corresponding index of the table data (using the i variable)

{{ distinct_options.data.options[i].map(x => x[0]) }}

Hi Everett,

Thanks for your reply and the expandable row suggestion. I had contemplated that as an approach to return suggestions to the user... and I can certainly see it fitting with other use-cases. Appreciate the example :pray:

For this particular solution I'm now leaning toward a 3 tag visual for reference and another tag column for selection / custom inputs.

:+1: