# Flex Repeater - How can I get the instance number to use in a binding within that instance?

**URL:** <https://forum.inductiveautomation.com/t/flex-repeater-how-can-i-get-the-instance-number-to-use-in-a-binding-within-that-instance/75509>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 26, 2023, 5:12am UTC](https://forum.inductiveautomation.com/t/flex-repeater-how-can-i-get-the-instance-number-to-use-in-a-binding-within-that-instance/75509 "2023-06-26T05:12:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craig\_Rathbone](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@Craig\_Rathbone](https://forum.inductiveautomation.com/u/Craig_Rathbone)\
**Post date:** [June 26, 2023, 5:12am UTC](https://forum.inductiveautomation.com/t/flex-repeater-how-can-i-get-the-instance-number-to-use-in-a-binding-within-that-instance/75509/1 "2023-06-26T05:12:37Z")

</div>

Hi, I have a flexible row I've built using a flex repeater, where the label uses a Descrition parameter per instance for the text label and a TagPath parameter for the root tag (of a UDT). On other uses of this I just type the label in, but I'm making a more dynamic page for some tags which have already have a description as a subtag in the UDT and I'ld like to be able tyo dynamically bind that instances tagpath into the tag reference for the description without needing to engineer another shape.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/0/b0753ff7c00746c1bfbab808718923143886cc4a.png)  
I can bind this by using for example:

```auto
{this.props.instances[0].TagPath}

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/4/c4dcb0cdbdb881d0d07bf0dbc7508fcb3b217b2f.png)

However I have to manually enter the instance id, this of course would break if I inserted another instance in the middle etc. Is there any way to get the id of the instance programatically to use in a binding without doing it manually? {this} gives me the FlexRepeater not the instance within the repeater.

I hope this make sense! Any tips?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 26, 2023, 5:41am UTC](https://forum.inductiveautomation.com/t/flex-repeater-how-can-i-get-the-instance-number-to-use-in-a-binding-within-that-instance/75509/2 "2023-06-26T05:41:32Z")

</div>

This was my reason for pushing for this feature:

> [@SVG Elements - Binding Property Path References](https://forum.inductiveautomation.com/t/svg-elements-binding-property-path-references/59101/7):
>
> I’ve created an idea:

---

<div class="post-metadata">

**Author:** ![Craig\_Rathbone](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@Craig\_Rathbone](https://forum.inductiveautomation.com/u/Craig_Rathbone)\
**Post date:** [June 26, 2023, 5:50am UTC](https://forum.inductiveautomation.com/t/flex-repeater-how-can-i-get-the-instance-number-to-use-in-a-binding-within-that-instance/75509/3 "2023-06-26T05:50:48Z")

</div>

Voted! a `thisInstance` or something similar would be really handy!

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 26, 2023, 8:41am UTC](https://forum.inductiveautomation.com/t/flex-repeater-how-can-i-get-the-instance-number-to-use-in-a-binding-within-that-instance/75509/4 "2023-06-26T08:41:07Z")

</div>

It looks like your instances are not dynamically generated, so why use a flex repeater ?  
It seems to me it would be easier to just use embedded views.

If you have a lot of instances and a flex repeater made it easier because each instance parameters follow a pattern, you could generate all your instances at once with a script transform in a binding on the `instances` property, where you'd be able to get an id/index for each of them quite easily (with `enumerate` for example).

Broadly speaking, if there's no binding on the `instances` property, I believe there's an easier way to do things.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 26, 2023, 11:42am UTC](https://forum.inductiveautomation.com/t/flex-repeater-how-can-i-get-the-instance-number-to-use-in-a-binding-within-that-instance/75509/5 "2023-06-26T11:42:10Z")

</div>

It seems to me that you are trying to do something in the data for the flex repeater that properly should be done by the flex repeater's view. That gets the tagpath and can extend from it without having this problem.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 23, 2024, 10:49am UTC](https://forum.inductiveautomation.com/t/flex-repeater-how-can-i-get-the-instance-number-to-use-in-a-binding-within-that-instance/75509/6 "2024-03-23T10:49:55Z")

</div>

@Craig_Rathbone, @nminchin, see my answer to [Perspective Text Field Numeric Keypad - #41 by Transistor](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/41).  
There is a secret "index" parameter passed to each instance of the flex repeater and you can use this for a variety of purposes.

> **[Perspective - Flex Repeater | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-embedding-palette/perspective-flex-repeater#description)**
>
> The Flex Repeater component lets you easily create multiple instances of views for display in another view.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 23, 2024, 11:02pm UTC](https://forum.inductiveautomation.com/t/flex-repeater-how-can-i-get-the-instance-number-to-use-in-a-binding-within-that-instance/75509/7 "2024-03-23T23:02:08Z")

</div>

Documentation is literally the opposite of "secret". 🤣

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 23, 2024, 11:04pm UTC](https://forum.inductiveautomation.com/t/flex-repeater-how-can-i-get-the-instance-number-to-use-in-a-binding-within-that-instance/75509/8 "2024-03-23T23:04:08Z")

</div>

OK, it's hidden in plain sight!
