Assign multiple tags dropdown from joining table

Hey bubblers,

I encountered a problem during the development of my new app. In short, the app is very similar to a project management system, but users can create logs to which they can assign users, tags, categories, etc. I have chosen to build the whole database with over 40 tables following a relational structure to achieve the best flexibility, reliability, and scalability. Therefore, I use joining tables to set up many-to-many relationships between tables, as in the example below.

I would like to be able to make a dropdown in the form where new logs are created. This dropdown I plan to build this following the structure below with a focus group.

In short, I am experiencing the problem when I need to create the log_assigned_tag relationship between the log and the team tag. I can’t do a search for log_assigned_tag because it will probably be empty before more tags have been assigned. Thus, the user cannot see which possible tags can be selected, and vice versa, if I searched for team_tags.

I would like to know if anyone has any ideas on the workflow I should use to pass the correct information between tables.

Thanks in advance.

What exactly is the problem?..

Populating the items in your RG?..

Or assigning them to the Log datatype in a workflow?

I can’t do a search for log_assigned_tag because it will probably be empty before more tags have been assigned.

I don’t understand what you mean by that? - can you clarify? (I don’t see why that won’t work?..)

Although, personally, I wouldn’t use a separate datatype for the log_assigned_tag (I can’t see any reason to here)…

Unless you’re expecting each log to have hundreds/thousands of tags, and/or you specifically need to store some additional data about when and how a tag was assigned to a log, it will be much simpler, and probably more performant to simply have a list of tags field on the log datatype, and get rid of the log_assigned_tag altogether…

Then you can just use the Log’s tags as your datasource…

But in either case, it should be simple, so perhaps you can elaborate on exactly the issue you’re having here…

1 Like

Hi Adam,

I want to establish multiple many-to-many relationships in a log. This means that a log can have multiple different tags, and a tag can be related to multiple different logs. I’m trying to avoid using “lists of things” to prevent data redundancy and maintain flexibility. I also want to store historical data about, for example, which user assigned a particular tag and when it was assigned.

The problem I’m facing is that when I try to create a multiple dropdown, the data that populates the various options is retrieved by searching for team_tags, where multiple tags can be selected for a given log. Once the form is saved and a workflow is run with the first step of “creating a new log”, I would like to create a new “create a new log_assigned_tag” record for each of the tags that were assigned. For example, if four tags were assigned to a log, the workflow would repeat “create a new log_assigned_tag” four times, creating four records.

I’m not sure how to set up this workflow or how to assemble the inputs into the form.

Another issue arises if, for example, some tags have already been assigned. How can these options be highlighted in a list so that the user can see which tags are already assigned? There are no fields in the team_tag table that indicate whether a tag has been assigned.