I have a series of tags users can use to identify themselves. Tall, short, chubby, etc. I want each user to be able to create a filter using buttons to then select a group of tags and see which users have self-selected those same tags.
User A is tall and chubby
User B is short and chubby
User C searches for chubby, he gets User A and User B
User C searches for tall, he only gets User A.
User C searches for skinny, he sees no results. He shouldn’t see himself in his results, that’s not helpful.
I’m having a hard time setting up the part that creates the entry in the join table. I know I need a join table with a user id pointing to which tag they selected (the row contains the ID that matches the tag). That’s where it all falls apart for me.
Do I need to set up a checkbox for each tag and ask the user
“Do you select Tag 1? Yes/No”
“Do you select Tag 2? Yes/No?”
I would really like to avoid building all of that if I could just use checkboxes, but I don’t know how to write to a table when the user taps a choice button, and if I create a joined list and try the Trebuchet method here it doesn’t work because the user could have selected tall first or chubby first, and so they won’t match if the user selects the chubby filter first and there’s a mismatch. I hope this all makes sense.
I hope that made sense.
I’m not sure why you think you need a join table for this?
Below is a Concept Template that I created a couple of years ago that demonstrates an approach to dynamic tagging and filtering. It could probably be simplified with some newer techniques, but it may give you some ideas.
1 Like
ChatGPT is helping me when I run into problems as I code and it suggested it. The one-to-many tables made sense, so I just thought it was a natural leap to think that this was an example where I needed even more tables.
I’ll give this a look. Thanks much!
@Darren_Murphy I’m not sure what I was expecting when I opened this, but it didn’t click anywhere near what I had hoped it would. I guess I was thinking there’d be space for commented code or something similar.
What’s the Tag Helper table do and how did you build it? Why?
How did your screen update to include “round” when I suddenly threw it into the mix?
How do these relate to my tags? Are my aesthetics tags in this example your categories?
Why is there a random column?! What does it do?
Thanks for your help so far. Appreciate the feedback.
The primary purpose of the Helper Table is to get a list of unique tags to use in the filters. There needs to be enough rows in that table to cater for the maximum number of unique tags.
If you look at the Things table, you’ll see the tags for each Thing are stored as a comma-separated list in the Tags column. This column is used in the helper table. So as soon as you create a new tag, the helper table automatically picks it up. This is why the template is called Dynamic Tags 
I don’t know, I haven’t seen your App. I just offered this up as an example of an approach to dynamic tagging/filtering. You’re welcome to copy the template, and adapt any or all of it for your specific use case.
There is no random column. Can you show me a screenshot of the one you are referring to?
This is the column I meant.
Even if I don’t understand it yet, at least I have a working copy of the design I’m going after. Thank you for that.
oh… I missed that.
Well, the column selects a random image from the same table.
But it’s not actually used in the template, so you can ignore it.
I’m not sure why it’s there. Probably I was experimenting at the time and forgot to delete it.