Multiple "tags" in table column

I have a table where I want to show multiple "categories" using the "pill" format shown in my screenshot. As you can see, I've tried to structure the data in my test table in every possible way such that my column would show different "pills" for each category as a different pill and different color (i.e., cat1, cat2, cat3). Instead, I'm just getting the one "blob" of all categories.

Is this even possible in Retool? If so, how should I structure my data source?

Thanks!

Hey Hess!

Certainly possible, all the category data needs to be in array format and then the tags will work.


image

To further clarify this - it only applies to New Table component (not the legacy one).

Hope this helps!

Do you possibly have a different column type than I have? I have a "Tag (Dropdown)" option for the column type, but yours appears different than mine.

CleanShot 2023-05-24 at 09.44.06@2x

This only works on the New Table component, the Legacy table does not natively support multi-tags.

Hope this clarifies it!

Yes...thanks! I "upgraded" and old table, but starting from scratch gave me the option.

Now I'm not clear on the data source....in my table should it be an object with arrays in the object or just an array? I feel like I'm trying all the possible options, but nothing's quite working.

To clarify...my data (though I can change it) is in a database table in a column formatted as text and I have arrays like

["cat1","cat2","cat3"]

Should this work or do I need it as a type JSONB and have an object like:

{"categories":["cat1","cat2","cat3"]}

So the table will be populated by an array of objects, and the category within those objects needs to be an array.

i.e.

[
{"id":1,"name":"test1_name","categories":["cat1","cat2","cat3"]},
{"id":2,"name":"testing2name","categories":["cat1","cat2"]},
{"id":3,"name":"name3","categories":["cat2","cat3"]},
{"id":4,"name":"totally_test","categories":["cat1"]}
]

Got it working! Thank you!!!