Hi everyone, I’m building a directory app where each listing currently belongs to a single category. However, I’ve run into situations where a single listing needs to be associated with multiple categories. For example:
Listing 1 → January
Listing 2 → February
Listing 3 → January and February
What would be the best way to structure this in the database? Should I create a relationship (like a many-to-many relationship) between listings and categories, or is there another approach I should use to allow one listing to reference multiple categories?
In your Listings table you can have a column that contains a comma separated list of Categories. Use a Split Text column to create an array from that, and use the Split Text column in a relation.
You just need to be careful that your category names don’t contain commas. If they do, the above will break down. A workaround to that would be to use CategoryIDs (RowIDs) instead of Category names.
Another way is to create an array directly by using a Multiple Texts column.