Entries relations

By: Ramon Vicente Silva | Asked: 10/29/2024
ForumsCategory: How-toEntries relations
Ramon Vicente Silva asked 8 hours ago
I am building a COGS site. I have the following forms, for example: Products:
  • Name
  • Amount on the box
  • Price of the box
  • Unit price = Amount on the box / Price of the box
Products Recipe:
  • Name
  • Repeater:
    • Ingredient = Dynamic field related to Products
    • Quantity
    • Unit price = Unit price of the product
    • Price on the recipe = Unit price * Quantity
My problem is that I can't make calculations with list values of the dynamic field. I need the price on the recipe to be updated automatically when the price of a product is updated.
1 Answers
Victor Font answered 8 hours ago
I'm not understanding your workflow from your description. Developers use lookup tables and repeaters regularly without issue. I am assuming the name field in your product table is the source of the ingredient field in the recipe, is that correct? If so, populating the unit price is done through a second dynamic field that watches the first one. See this for further details: https://formidableforms.com/knowledgebase/dynamic/ Dynamic fields provide a "hot link" to the lookup table data based on the lookup table's entry ID. This means you will always see the current values from the lookup table, even in old entries.
Ramon Vicente Silva replied 8 hours ago

I'm using a second dynamic field to retrieve the unit price, and it's working. However, I need to perform calculations with this unit price, specifically to calculate the price on the recipe (Price on Recipe = Unit Price * Quantity). Unfortunately, since the unit price is in a dynamic field, I can't use it in other fields.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right