Ignition Perspective Flex Repeater

I am having a hard time figuring out how I can do this... I have a view that has a flex repeater on it. The flex repeater uses a single template seen here...

I have the textfield for Quote Number bound to an indirect tag

[default]TagQuery/changeOrderCompleted[{instanceNum},1]

On my view, i have a startup script that will determine the number of instances needed to be displayed based on the value of a set of tags. Let's call the base tag 'coQN'. I have the tag 'coQN1' thru 'coQN10'. The script is basically reading in all of those tags and I then check to see if the value of each of the tags has an actual value or is 'null'. If the tag comes back with a value not equal to null, an instance is created. So there could either be 1 instance or 10. This is working as intended.

My problem is that I cannot get the data to correctly display in each instance of the flex repeater. The picture below shows the flex repeater that has 3 instances.

The first instance (with the Quote Number text field highlighted in Green) is displaying the correct data. Tag is changeOrderCompleted[1,1] which has a value of 'CO7843-01-02'.

The second instance (with the Quote Number text field highlighted in Yellow) is displaying the incorrect data. Tag is changeOrderCompleted[1,2] which has a value of 'CO7843-01-03'.

The third instance (with the Quote Number text field highlighted in Yellow) is displaying the incorrect data. Tag is changeOrderCompleted[1,3] which has a value of 'CO7843-01-04'.

I realize that I need to increment the tag, but I am not sure how to achieve this by because they are "grouped" together and not isolated.

Thank you in advance

in the instances prop of the Flex Repeater do the params have correct values? If that is not the case then it is a problem with how you are generating the instances.

Show us the script that generates the instances, and tell us exactly what parameters your templates take.

But frankly, I'd rework things a bit. Use bindings instead of a startup script.
Pass a tag path to your instances and let them handle their data and state themselves.

1 Like

You were right, I wasn't passing the right parameters. Got it working, thanks!

Great! I would still consider what @pascal.fragnoud said. You should really just have the instances bound to that tag and base the instance logic off of that in a transform. You may find your startup script to be unreliable sometimes.

I would also question why you are using a tag for a quotation application. Surely it should be directly interfacing with a database?

1 Like