How do I link two objects together in the database?

So I have two objects in my database:

  1. Product that has: votes, a logo, title, description, images, etc
  2. Comments that has: a product

My confusion stems from the proper way to organize the database.

Essentially, the app has a product input page where the user can input information about the product like the title, logo, description, etc.

Once the product information is entered, the user will be navigated to the “show current product page.” On this page they would see the data they entered displayed in a variety of repeating groups.

The aspect that I am confused about is with the comments. In my database I have a comment object that contains a product that is type product. In my product object, I have a comment of type “list of comments.” The reason I structured it this way is because each product would have a list of comments from different users. Is this wrong? or should I try to manage this with option sets?

Now, when developing my repeating group to display comments associated with one product, I am not sure the type of logic involved to properly display.

Here I have a group under my repeating group that will inherit the current pages product’s comments, however I am not certain on the logic:

With the repeating group, its the same issue. I am not sure how the logic should flow with connecting the current pages product to its associated comments:

Hi there, @pauljoneswv… if I understand your post correctly, set the group’s data source to Current Page Product and set the repeating group’s data source to Parent group's Product's comment, and you should be good to go.

Hope this helps.

Best…
Mike

This topic was automatically closed after 70 days. New replies are no longer allowed.