Referencing multiple child data types to respective parent data types in the backend

Hi fellow Bubblers,

How should I reference multiple child data types to respective parent data types in the backend?

This should be a relatively long post so here’s a cup of coffee while you read :coffee:

For context:

I have 2 dynamic repeating groups wherein 1 is nested. By dynamic, I mean the number of cells are dynamic since the repeating groups’ data source is a list of numbers element with a dynamic length referencing to a state.

To alter the number of cells in each repeating group, I have 2 inputs where if input's value is changed, set the state to this input's value

Now, what I’m having trouble is how should I reference each meal to its respective day? Should be very easy if there was only 1 day but the number of days are dynamic. Plus, accessing the inputs in the repeating groups is another thing.

To paint a better picture, here’s my data structure

Accessing the inputs in a repeating group is not a problem since we could use the orchestra plugin or go with the reusable element route. (I haven’t tried the BDK plugin) The challenge is how should I reference the each meal to its respective day in the backend.

I have tried to implement this flow using these routes but got no luck :frowning_face:

  1. Use the orchestra plugin to access each day cell and schedule a backend recursive WF to create multiple days.

The backend WF has a meal plan parameter so I could simply reference each day to a meal plan. The issue with this route is that when creating meals using a recursive backend WF, I am unable to reference each meal to its corresponding day since the number of days are dynamic.

  1. Using a reusable element in each cell to access the inputs

Similar with the first route, I can create multiple days and have it reference to a meal plan but when it comes to creating meals and referencing them to their respective days, it is till not possible.

Thanks for reading this post! Since we’re in the meal plan business, here’s a free meal :bento:

I would REALLY appreciate any help that I could get.

Best,
Nino

P.S. Thanks again @dorilama and @adamhholmes! The previous thread was for this process

It just occurred to me while I was writing this post…

Referencing each meal to its respective day should be easy using this recursive workflow

But the issue now would be how would I reference to the specific inputs in each day and meal cells?

Would’ve been very easy if it had a static number of days and meals, but it is dynamic.

A little bit more and we’ll solve the puzzle!!