Data type design for header/detail relationship

I’ve currently got my first effort at a bubble app running (love it). It is a basic product master application where I have masterfile data types for labor, raw materials and assets that contain types of expenses and rates for each expense type. EG:

The user designs a product and in doing so, creates detail records for datatype:costdetails which when summed provides the COGS for the product. In the UI, when planning a new product, the user can select expense type, enter quantity and then a workflow creates a thing in a costdetail data type, where costdetail.cost = the quantity * rate of the raw material. EG:

The datatype for costdetail looks like this:

My challenge is now figuring out how to update costdetail:cost records when user changes underlying rate values in labor, rawmaterials or assets master datatypes. I imagine I can create some edit workflow that finds all records with matching type and possibly recalculate cost within costdetail records. But that seems wrong and I’m wondering if I just have bad datatype design and there might be a better way to do it where the relationships between rate can be related between the tables and so edits update cost automatically? Any advice?

Sorry if this is newbie question, I’m used to solutions more like access or filemaker where you hard define the relationships so feel like I’m mistaking some data design fundamental here.

api workflows on a list…watch the youtube video tutorial on the “coaching bubble” channel

Oh my gosh. This is nearly the exact same example. Thank you so much!

1 Like

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