I am trying to create a classic bit of blog functionality:
• Each blog post has an array of tags associated with it.
• Users can filter all posts to show only the ones with the tags they’ve opted to filter for.
I currently have a table with rows of unique items (“posts”).
Each post has multiple “tags” in a single cell.
I want to filter the list of posts using a choice component that allows me to select from a list of tags available (from the “tags” table ). If I select tags A, B, & C from the choice component, I want to see all the posts that have any of those three tags in their row.
Unfortunately, I can’t find a way to compare the two arrays (“Tags” & “Tags Select”) to find matches between the post tags and the selected filter tags. Is this even possible? Any tips greatly appreciated!
You should be able to split the selected tags, then do a multiple relation from that array to the “tags split” array. Display the relation result in an inline list/collection.
Beware of where you store the “tags select” column though, I see you’re storing it in the same table as the posts. I would build the screen on top of the user profiles table, filtering it to the signed-in user’s email.
1 Like
Thanks so much, I’ll give that a try.
Also, agreed I don’t want the “TagsSelect” data writing to the Posts table.
However, I’m not exactly sure what you mean by “build the screen on top of the user profile table”.
The Posts screen is built as a display of inline lists from the Posts table because that is the relevant content. I’m not sure how I would build a Posts screen with the User Profiles table - can you explain that a little further? I really appreciate your help & expertise here - thank you very much!
You can just have a tab that:
- Points to the user profiles table
- Filter the tab by email is signed-in user
That way, you have access to the row of the signed-in user. You can have it as a details-layout tab, so you can add inline lists as needed, it doesn’t have to be from the same table.
I believe putting the “TagsSelect” column in there, as a column in the user profiles table would be a better choice of data structuring.