So far I only found the suggestion to use a third "join" table (https://community.filemaker.com/thread/117213?q=How%20to%20display%20in%20a%20portal%20all%20children%20of%20a%20parent? ).
Is there still another way to handle that?
Not really – that is the most efficient and flexible way to handle many-to-many relationships, which is what you have – a recipe requires many ingredients, an ingredient can appear in many recipes. Every other approach is simply not worth mentioning.
I wonder how you did this now …
The recipes contain up to 20 lines showing all ingredients in different order (i.e. in one eggs may be in the first line and in the next eggs might be in the fifth line).
What is a “line”? Do you use repeating fields?
Note that a join table will simplify things, because now every occurrence of a ingredient in a recipe has its own identity and can be attributed differently – for this recipe you need 200 g of almonds, but for that one you need 100 g. Also, using a list layout with all related join table records of a recipe is a simple way to print a check/shopping list (which you can sort by any attribute of the ingredient and/or its parents).
Sorry - I should have said „rows“ not lines.
The reason I have created the file in the first place was to document my daily calories, protein and some other nutrition critical for my heart condition. The nutrition data are collected from the internet and entered in the „Zutaten“-Table (Ingredients).
The second table „Speisen“ (recipes) is related to the ingredient-table. The links are the names of the ingredients. They determine which details are shown in their row
The third table „Mahlzeiten“ (meals) gets its input from the recipes-table. Here I have for breakfast, lunch and dinner 5 rows each. Depending on the recipe selected for a given row the nutrition data is copied/pasted in the respective field using individual scripts.
Originally I had defined also here dynamic links but the updating process after entering data in one single field slowed down FMP quite a bit. Besides - certain functions work only if a field contains text and not a formula or link. The file is already a little cluttered because I have adjusted for example what columns are shows several times.
It’s not comparable to neat commercial apps which help you monitor your health-related data. But I prefer driving a car with a shift stick and not with an automatic where I cannot „see“ all details (still more common in Germany). And as said - I need to adjust the database from time to time.
Hope that my first attempt to attach a file will work
Meals.fmp12.zip 230.3 K