How to store multi input dropdown values in different rows

Hi all,

I am trying to achieve the below database structure.
3 tables:
Post
columns: various fields, unique_id

Tag
columns: Name, unique_id

PostTag
columns: post_unique_id, tag_unique_id

In my UI, I have a multi line input for the post, a multi input dropdown which fetches values dynamically from the Tag table.

Now when I click the “Post” button to post it, I want an entry in the post table which saves the new unique_id. The Tag table already has all the entries required, I am not writing to it from the input box, just fetching right now.
The PostTag table should store values for each tag entered. For example if the post has 3 tags, I should get 3 different rows with the same post_unique_id, and the separate tag_unique_id.

Right now, my workflow is like below:

This workflow saves the data in one row with all the tag values separated by comma.

Is there a way to do this, I couldn’t find any relevant post yet. And I am very new to the website altogether.

Most people would create a tag list field in posts datatype instead of a separate data type of post tag. Just curious why do you want 3 separate rows?

I did it by tag list by inside posts and that worked. for my use case. Thanks for the suggestion. However, I am wondering if that is a good database design. Posts by items in 3 rows I think would scale well.

Hey welcome!

I’m a little confused at what you’re trying to accomplish but I think it’s just because you’re new with the bubble architecture?

Each row of data that is created automatically has a “unique id” so there is no need to create that field again.

From your description, it appears that you only need a Post data type and a Tag data type. In the Post data type should be a field of type Tag that is set as a list.

Then for each Post, you’ll get a list of the Tags associated with that post (in your database, the list will show the unique IDs of each Tag separated by a comma).

Let me know if I misunderstood your question :slight_smile: