Copy fields from one data type to another upon form submission?

Here is what I want to do… but am having issues at the last part, and just may not be doing any of it right…
Lets say:
I have a Menu Planner
On Menu planner page there is a form for the user to submit their menu and what makes it up.
The user fills out the breakfast field - Omelet
then there is another form field this one for what is in it.
In the ingredients input field the user types in
Tortilla - presses the submit button and it appears in a repeating group below it
Eggs - presses the submit button and it appears in a repeating group below it
Sausage - presses the submit button and it appears in a repeating group below it
Cheese - presses the submit button and it appears in a repeating group below it

When the user hits the submit button
The menu table would contain a new meal in the meal column for breakfast and there will be a column for the ingredients.
Tortilla, Eggs, Sausage, Cheese

I built it out somewhat by creating a temp table for ingredients… all of that works fine…
The problem is upon submitting the main form… how do I copy the data from the temp table to the ingredients column in the menu table for the meal we are creating at that moment and then clear the temp table?.

Does this make sense?

OK
So your database structure looks something like this if I understood correctly:

  • Menu
    • Breakfast
      • Ingredients
        • Tortilla
        • Eggs
        • Sausage
        • Cheese

On clicking ‘submit’, your workflow probably contains “create a new thing” where you are creating the meal.

Within this action, you should be able to set the values of the fields contained within the “meal” entry by clicking “Set another field”. Here, select the “ingredients” field, set the operator as “set list” and the value of this field as the “ingredients” field of the temp meal.

Once you do this it should look like this:
ingredients set list tempMeal's ingredients

Hope this helps.

My structure is more like this…

• (Data Type) Menu
          • (Field) Breakfast
• (Data Type) Breakfast
          • (Field) Ingredients (Add Ingredients button adds individual "data" when pressed)
                          (Data) Tortilla
                          (Data) Eggs
                          (Data) Sausage
                          (Data) Cheese

When clicking on the Add Meal button at the bottom of the form it should add the (data) from the Breakfast Data Type to the Breakfast Field.

I think I must be going about this the wrong way… maybe I am just not wrapping my head around this right and my approach is all wrong?

I wasn’t able to get the set list to work, it would not populate with the correct options/fields or whatever you want to call them.

rethinking the structure… and a new example…
Say this was something like a CRM…
I have a sales guy who is on this form to create a new company name for us to sale to…
There is an input field for the company name
below there is a contacts field…
I want the sales guy to be able to input email address in the contacts field upon each new entry it will populate the repeating group below the field with each new email address…
At the end of the form the sales guy should submit the new company which obviously would put the company name in the company field and the email addresses in the contacts field within the sales leads data type?

Sales Leads
Company
Contacts

So submission would look like
Sales Leads
Company1:
ACME CORP

Contacts:
John1@Doe.com
John2@Doe.com
John3@Doe.com

Company2:
FakeCorp

Contacts:
Jane1@fake.com
Jane2@fake.com
Jane3@fake.com
Jane4@fake.com

OK.
So you have a form that when saved should create a new data entry of type ‘Breakfast’ and then insert a reference to this entry under an existing ‘Menu’ entry.

A. To debug I’d first make sure that a new ‘Breakfast’ entry gets created ( ‘create a new thing’ - type ‘Breakfast’ ) in the form submission workflow and set the list of ingredients in it’s ‘Ingredients’ field.

B. Once this ‘Breakfast’ entry is created, it should be added to a ‘menu’ entry via the ‘Make changes to…’ action. Here you could assign the ‘Breakfast’ field with ‘result from step 1’, assuming your step 1 was ‘create a new Breakfast’ (from point A above).

If this doesn’t do it, there’s something else that’s getting in the way. A good way to get to the bottom of it is by elimination.