# Recipe and bakery production management in Fibery? 🥧

**URL:** <https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603>\
**Category:** Get Help\
**Created:** [March 2, 2022, 5:22am UTC](https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603 "2022-03-02T05:22:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oshyan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/oshyan/32/11431_2.png) [@Oshyan](https://community.fibery.io/u/Oshyan)\
**Post date:** [March 2, 2022, 5:22am UTC](https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603/1 "2022-03-02T05:22:35Z")

</div>

OK, this is a weird, out-of-the-box use case, but I have a client looking for a solution and I want to see if Fibery is up to the task. And since the problems involved here are closely related to some _other_ challenges I have run into around _field proliferation_, _entity proliferation_, _storing temporary values_, _in-line_ (in Rich Text) _Field Values_ and _Calculations_, etc. I thought it worth bringing up here. I’m very curious if people have thoughts on how I can approach the following with current Fibery functionality, and whether any of the challenges connect with needs that _other_ folks also have in their work.

## Problem Definition

- Need to store and maintain Recipes that relate to Ingredients
- Ingredients include Pricing
- Ingredients need to be scaled for each recipe
- There are “production runs” or “bakes” where X number of units of a given recipe are made, and thus there must be scaling for Recipe which then requires scaling of Ingredient _for each recipe_ **for each bake** (e.g. 5x of recipe A, which includes 4 cups of unit X, 2 cups of Unit Y, 2 tablespoons of unit Z, so all need to be scaled).

Because of the need for different quantities and scaling for each recipe, and the fact that many recipes would share some ingredients, the only two ways I saw to do this were to

1. Have a new Field for every Recipe’s scaling value (a cumbersome approach), or to
2. Have a new “Scaled Ingredient” sub-Database Entity for every Recipe which uses a given Ingredient

The latter seems acceptable if I can automate creation of these sub-entities, although it still seems clunky.

Also desirable is a reasonably printable, Rich Text-style output of each scaled recipe + ingredients for a given “bake”.

## My Current Solution

I have begun prototyping this with the minimum needed fields, but am not finished. So I am not 100% certain that this will work yet, or _precisely_ how, since I haven’t completed it yet. But this is what I’ve come up with as a mental model. Let me know if you see a better way, or an issue with what I’m planning!

### Databases and basic relationships

- 4 databases
  - Bake (Production Runs)
  - Recipe
  - Ingredient
  - Scaled Ingredient

- Bakes have multiple recipes, recipes have multiple bakes
- Recipes have multiple Ingredients
- Recipes have multiple _Scaled Ingredients_
- Recipes have base Quantity and Scaled Quantity Fields
- Ingredients have multiple _Scaled Ingredients_ (relation)
- Scaled Ingredients Lookup some values from Ingredients (e.g base unit and measure, cost per unit)
- Scaled ingredients have “New Quantity” field for scaling

### Process

- You start by setting up Ingredients with name, unit, base quantity, and cost
- Add Ingredients to Recipe
- A Button then loops over Ingredients (collection) and creates Scaled Ingredients and connects them to the current Recipe (relations)
- Then set the New Quantity of each Scaled Ingredient for that Recipe (manually in each Scaled Ingredient in the collection)
- Now create a Bake and add one or more Recipes and a scaling value for each.
  - To avoid having to have a “scaled recipe” database, I’m thinking of just using generic fields in a Bake “Scale Value for Recipe 1”, but this is fragile.
  - It’s also only acceptable, where a similar approach for Ingredients is not, because there are assumed to be relatively few Recipes in a given Bake, but this may not always be the case.
  - Alternatively there could be a “Scaling for Current Bake” field in the Recipe database that just gets reset each time, but then you can’t maintain any record of what was done in the past as far as quantity of each recipe per bake.

- A button loops over the Recipes pulling the ingredients and scaled values into a Rich Text and appending for each one into the field on the Bake itself
  - Ideally this process can also calculate the _total_ quantity of each ingredient by checking the _parent_ Ingredients of each Scaled Ingredient and adding together the New Quantities for all with a common Parent.
  - The value of this would ideally go in a field somewhere and not just Rich Text, but this seems to run into the original problem: where do you put values that are only going to be needed this once? Do I have to create a whole new Type for this?

## What Could Be Better

How do you deal with values which exist for X number of Entities (e.g. you don’t know how many Ingredients will be in any given Recipe) but should belong to the Parent? That, I think, is the principle challenge here.

I’d love a better solution to a proliferation of special sub-database entities and/or fields just for the largely temporary function of scaling (although the scaled data would ideally be maintained, too). I think it might be doable entirely within a formula, but it seems complicated and potentially fragile, especially for someone else to maintain. At least the sub-ingredients are understandable for most people, even if a bit clunky.

Also a better, more flexible way to turn the data into printable text would be really nice. I haven’t attempted a version of this with Coda yet (pending!), but my expectation is that in-line values and formulae, etc. should allow me to do this a bit cleaner, without having to redo _everything_ in the Rich Text if I just change one scaling value, etc.

### Some past, related discussion

I think this would solve it by having a Value I could set for a Relationship uniquely for each Recipe to each Ingredient’s Scaling Value and each Recipe’s scaling value for a Bake:

> [@Relationship properties](https://community.fibery.io/t/relationship-properties/887):
>
> This might be a big ask, but would it be possible to add properties to relationships as well as entities (like is possible with a graph database)? I realise that the more sophisticated you make the underlying platform, the greater the risk of users being scared away by the complexity, but for me, it would put you into a whole different league. It could be a feature that can be enabled but is disabled by default so as to not scare non-techies…

> [@Relation with property (junction table)](https://community.fibery.io/t/relation-with-property-junction-table/693):
>
> Case: relation without properties Types: Recipe and Product. Relation: there is a product in many recipes and one recipe contains many products (many-to-many) Solution: two tables Case: relation with property Types: Recipe, Product and ProductRecipe Relation: there is a product in the recipe with a certain gram and vice-versa Solution: three tables In result of second solution i have this table: Table of ProductRecipes And it’s not convenient cau…

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [March 2, 2022, 7:12am UTC](https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603/2 "2022-03-02T07:12:05Z")

</div>

Have you looked at the Inventory management template?  
I get the feeling that it has a fair few similarities. In fact, I think it is rather close, if you map the terms:

Item = Ingredient  
Effect = Scaled Ingredient  
Step = Recipe  
Occurrence = Bake

![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/4/4ed7500e149bb2c36c2c4a0e2a0e4754340c7a47.png)

What it currently lacks is the ability to create a rich text summary of the Ingredients / Scaled Ingredients info for a given Bake, but I don’t actually think this would be too difficult.

Get back to us and let us know where you think the gaps are between what you need and what it does

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [March 2, 2022, 7:13am UTC](https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603/3 "2022-03-02T07:13:22Z")

</div>

Oh, and you might wanna watch this [video](https://www.youtube.com/watch?v=su2iU5TrtZw)

---

<div class="post-metadata">

**Author:** ![Bruce\_Onder](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/bruce_onder/32/272_2.png) [@Bruce\_Onder](https://community.fibery.io/u/Bruce_Onder)\
**Post date:** [March 2, 2022, 7:14pm UTC](https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603/4 "2022-03-02T19:14:12Z")

</div>

Ah, you beat me to it! 🙂

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [March 3, 2022, 8:16am UTC](https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603/5 "2022-03-03T08:16:00Z")

</div>

@Oshyan did you manage to get something working OK? Would be happy to help out if you got stuck or wanted ideas/feedback.

---

<div class="post-metadata">

**Author:** ![Oshyan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/oshyan/32/11431_2.png) [@Oshyan](https://community.fibery.io/u/Oshyan)\
**Post date:** [March 4, 2022, 5:12am UTC](https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603/6 "2022-03-04T05:12:20Z")

</div>

Ah, thank you! I just assumed it was so far outside the typical use case that there wouldn’t be a template for it, so I didn’t look. But I should have at least tried! In fact I think I remember the post about the inventory management template, and it appears that I even “liked” it. 😄

> [@Chr1sG](#):
>
> @Oshyan did you manage to get something working OK? Would be happy to help out if you got stuck or wanted ideas/feedback.

My forum interaction sometimes lags my “time to experiment” allotment. 😉 I have begun testing this, and I have a basic adaptation, but now need to figure out multiple recipes (steps) per bake (occurrence), among other things. But it’s certainly promising as an alternate way to approach the problems! Thank you again, and I’ll report back soon with further experimental results.

---

<div class="post-metadata">

**Author:** ![Tommy\_Hedley](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/tommy_hedley/32/6468_2.png) [@Tommy\_Hedley](https://community.fibery.io/u/Tommy_Hedley)\
**Post date:** [November 23, 2022, 8:41pm UTC](https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603/7 "2022-11-23T20:41:06Z")

</div>

Hey @Oshyan, did you ever end up building something for this use case? I’ve been considering something like this as a personal project, but I haven’t dug into it too much. I think the whole process would be much easier with some Coda-style in-line formulas but it might be possible without.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [November 23, 2022, 9:36pm UTC](https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603/8 "2022-11-23T21:36:55Z")

</div>

Hi @Tommy_Hedley  
If you haven’t already, check out the inventory template and watched the video linked above.  
Perhaps they will provide inspiration.

---

<div class="post-metadata">

**Author:** ![Oshyan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/oshyan/32/11431_2.png) [@Oshyan](https://community.fibery.io/u/Oshyan)\
**Post date:** [November 24, 2022, 6:06am UTC](https://community.fibery.io/t/recipe-and-bakery-production-management-in-fibery/2603/9 "2022-11-24T06:06:53Z")

</div>

I never did, no. The person I was working with ended up deciding not to pursue it further. I think they just stuck to hand-written notes 😄. I’m still interested in this kind of thing, but I doubt I’ll have time to implement it any time soon. If you do I hope you’ll share your experience, or even a template! I agree Coda’s in-line fields would make it better, but I’m curious to see how far one can go with Fibery, especially as it gains new capabilities regularly…
