I’m having a hard time implementing some functionality. First, a little bit of background:
I’ve got a few different kinds of things:
I’ve also got some things that are acting as join tables:
So users can have many data objects, and those data objects can have many users. Similarly with tags: a data object can have many tags, and a tag may apply to many data objects.
I’ve done it this way because I’d like to implement a social component later that can track the prevalence of certain data objects and tags across the user-base as a whole. The “join table” approach is a holdover from how I’d solve the problem in something like Rails or Meteor; my apologies if it’s not the Bubble way.
The functionality that I’m having a difficult time with is letting the user select a group of tags and displaying only the pieces of data that have all of the tags selected; right now, it displays all of the pieces of data that have at least 1 of the tags selected. The approach I’m currently using is:
- User selects a tag
- Tag is added to a list of tags contained in the current user object (couldn’t think of another way to implement this in Bubble)
- List of data objects displayed is updated: I search for all Data2Tag entries where the tag is in the list of tags contained in the current user object and I search for all User2Data entries where the user is the current user
I have a few ideas as to how to implement this, but I can’t quite figure out how to fit them into a Bubble workflow. I was thinking one of the most promising would be if I could search for a list of all data objects through User2Data with user = current user and then convert the tags from all of the associated Data2Tag objects to a list on a per data object basis, I could compare that resulting list of tags with the list of tags contained in the current user object.
I’m having a hard time with the “per data objet basis” part. Any suggestions or tutorials that I might find helpful? Thanks in advance.