Tags field


#1

I am currently testing with Postgres but have not settled on a final DB yet. I am wondering what the most user friendly way to handle tags is currently? It doesn’t look like array types are supported in any of the databases yet? Is there any way to setup a system allowing people to filter for multiple comma separated tags?

Examples:

Field: tags
Value: tag1, tag2, tag3

SELECT * FROM table_name WHERE ((( tags contains tag1 OR tag3 )))

SELECT * FROM table_name WHERE ((( tags contains tag1 AND tag3 AND tag4 )))

SELECT * FROM table_name WHERE ((( tags contains tag2 )))

Note: I realize the italic part is not valid SQL, just for illustrative purposes


#2

Metabase handles all that for you.
Start here: https://www.metabase.com/docs/latest/users-guide/13-sql-parameters.html


#3

I haven’t been able to figure this part out? Should I be storing this as a json array or a comma separated string?


#4

Are you integrating in a web page, or just designing in Metabase? If just in Metabase, the UI takes care of it.
If integrating, going to take a bit more typing…


#5

Is it possible to have each value in a comma sperated list field (or array field) as a user defined variable, but have a Category style drop down list of all the values as options in a dashboard filter?

This would be instead of a text filter which works for me when wrapping search terms in % to find any of, ie %Tag1%.

Alternatively is it possible to store the tag names in a seperate table (Tags_list) then map the Tags variable to that Tags_list column as a Field Filter (with category widget type)?