I'm creating a basic workout plan builder which allows you to define any number of days and each of those days has any number of exercises. I have a program variable defined in Toddle and inside that there is a days object with a name and array of exercises[].
Each exercise object has a name as well.
I've attached a photo of the initial value of my program variable to show an example of the structure.
I'd like the user to be able to edit the exercise name on any given day and so I have an inline-value-edit element from the starter-pack package and on the setEditedInput event I have a formula where I try to update the program variable by setting the name on a given exercise for a given day (based on the indices provided by repeat variables and input field the user selected), is there a way to simplify this formula?
I'm used to coding where I could easily just do something like program.days[parentIndex].exercises[index].name = value in one line, but it seems like in Toddle I have to create a large formula for what seems like a simple operation, but perhaps I'm missing something.
Is there an easier way to specify the Path value on that right-most Set to just provide the day and exercise indices to set the name and return the updated program as the output?
Or is it typically easier in Toddle to limit how nested your objects get where instead of having a program object I'd just surface all the nested elements as separate variables and have a days variable instead?