Forum Academy Marketplace Showcase Pricing Features

Looking for advice / setting up my database

I´m new to Bubble and I hope somebody can give me a litte hint on how to set up my database correctly.

I want to create a review app: A user can create a new review for a “product” and this review can contain several positive and negative facts about the product. For example:

Review for car YXZ
Positive:

  • new engine
  • good quality

Negative:

  • High price

So, one review with two positive facts and one negative fact.

The end result should be a page for each product. I hope my following picture makes this more comprehensible.

(1) Each product has its own page.

(2) On top of the page, the logged-in user´s review should be displayed (only if he has submitted a review for this product)

(3) To make things more convenient for the user I would like to offer a drag and drop feature for his own review. > The user should be able to add new positive oder negative facts and then be able to arrange the order of the facts via drag and drop.

Therefore I think the database should contain the order/ranking of each fact.

(4) Below the user´s review all the other reviews from different users should be displayed.

I´m really struggling on how to set up and structure the database and how to display the data. The first part (see #2) is probably a drop zone but #4, how do I display this? Is this a repeating group inside a repeating group? For any help or hint I would be deeply grateful.

I think it depends on whether these reviews are static or not. So is the user entering their own text, or selecting from a pre-defined list.

Either way you will end up with a Car > Review > Comment structure

For 4) you could certainly use a repeating group (comments) within a repeating group (review) where the review creator is not the logged in user.

@NigelG Thank you!

The reviews should be not static. Each user should be able to modify them at any time.

What do you mean with " Car > Review > Comment structure"?

Ok, so I can have a repeating group inside a repeating group. Perfect. But I still have no clue how how many databases I need for this.

The first would probable be:

Reviews

  • Comment
  • Pos or Neg
  • Order
  • Type of car
  • created by

Do I need a second one to use for the repeacting group or can I use one database in this double “repeating group structure”?

This could even be as easy as creat review, in the review data you add to a list of positive and add to a list of negitive. Then the repeating group for positive have current reviews positive:item#current repeating groups cell id and so on. @NigelG havent tried it but seems like it could help?

That was a fairly basic representation of your database structure.

I would guess you would need three Data Types (aka tables) to start with. That will make it a lot easier to format the repeating groups.

So …

Car - Type/name etc

Will have a list of Reviews…

Review - Created By

Will have a list of Comments

Comment - text / post neg

Can a repeating group inside a repeating groups cell have the contraint review = “parent repeating groups cell id”?

Not sure why you would need that, as you can refer to the parent cell’s value. You would just show Current Cell’s Review’s Comments in your nested RG.

I just read my question and im not sure what i was thinking there for a second… lol. Your answer is what i was getting at though. So if i had a one data set version of this i could have the internal RG reference the external RG’s cells data with the contraint positive is not empty.

@NigelG @jarrad

Ok, thanks. I will try and create the three Data Types and see if I can get this to work.

Have a go, and if you get stuck let us know.

Often the best way to get help is to have a public app that people can view.