Hi all,
Been doing some reading on "Dynamic Flex Repeaters" and found a lot of good info on using a script transform on the props.instances.
Using this example by @YF129701, creating instances and setting fixed parameters are easy.
However, I would like to pass values that change depending on how many instances are needed, and values that would be associated with additional Flex Repeaters nested within them.
For my use case, there are three views: the parent, the repeaters within the parent, and the repeaters within the repeater.
Ideally, the primary and secondary repeaters would be using a script transform to set the number of instances needed, and passing other values as well.
Using this transform on a static value for testing:
obj = {
"instanceStyle":{"classes":""},
"instancePosition": {}
}
objList = []
for i in xrange(value):
objList.append(obj)
for o in objList:
o["blockId"] = self.view.params.blockId
o["zone"] = 1
return objList
Returns this:
Well, each of those instances needs a different
zone value. The values are not necessarily sequential either, which seems to make it more difficult. I could use a two column dataset of which zones to use, and this begs the question how would each scripted instance know which zone number to retrieve?
If this can be solved, I think I could use the same method to pass values to the secondary repeater to change the values you see with the light blue highlight. Currently, the secondary does not use a script transform, as I haven't figured out passing dynamic values through yet. Here are the current instances on the secondary:
bay and position determine the value of the light blue components.
Also, @bmusson mentioned he uses a message handler on the props.instances, in Ignition Early Access 2019. I am not sure this would be much different, maybe?
Thoughts on getting those dynamic values to pass to the parameters in each instance? Thanks!
Edit: I am also thinking of using the params on the secondary repeater as in/out, to pass changes back to the primary repeater, so that when the user saves the data, I can run fewer scripts on the primary repeaters, rather than 3x that on the secondary.

