I think the way I would go about that is to create a script to do the following:
1. Loop through the records in the portal, gathering the data using Set Variable. I would set the variable up to add each line of contents to itself, so that by the end of the portal the variable contains all the contents listed in your prescribed format.
2. Create a record in the recipe table, or wherever you intend to write that detail, and populate the recipe field with the contents of the variable.
Add a calculation field, cFoodName_Amt to Dish|Food that combines the food name and the number.
Dish::FoodName & " " & FoodAmount
Then, from Dish, this calculation will produce the desired result:
List ( Dish|Food::cFoodName )
You could use the FoodName field from DIsh|Food in the above calculation if you want, but there is no obvious need for this field to even exist in your solution. In your portal, for example, you can put the Dish::FoodName field in the portal row and not need to look up the name.
Many thanks for such a straightforward and useful answer.
Just out of curiosity, since the data on the portal is sorted based on Dish|Food::FoodName (text, lookup), would it be possible to maintain this sort order using your approach, or for this to happen would it be necessary some scripting?
Thanks for your suggestion.
I am afraid, I don't have the needed expertise to implement what you suggest.
Disregard my question about sorting a text field. I found a sorting custom function.
Thanks for your answers.