Query setup question

I have 3 tables in my data base that are arranged:
punchlist_item>>belongs to>>asset>>belongs to >>brand

  1. Is there a way to first query a list of brands with asset punchlist_items.
  2. Use that list as a query filter for punchlist_items by brand.


@jdavidpugh The easiest way to do this, is to denormalize your data and then create and maintain a direct relationship between punchlist_item and brand. This type of denormalization is also often required for sync-rules

But, depending on the use case, number of records and UI requirements, you could also just drop all the punchlist_items into an object-table, display the asset.brand.name in a <column>, add a filter to that column. Then the user can simply use the object table column filter to filter by brand whilst looking at punchlist_items.

If you do not want to do either of these then there is one more option which basically involved “collecting” the unique IDs of all the asset objects that belong to the selected brand and then doing a query on the punchlist_item table using all those IDs. I will ad an example shortly

@tielman Thanks for the clarification…As this grows in use option 1 may be the best alternative.
When I first started I wasn’t sure if there were negative impacts of “too-many” belongs-to and has-many data links other than data volume.