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
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
- 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.
- 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
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