# Flex Repeater - Get Selected Instance

**URL:** <https://forum.inductiveautomation.com/t/flex-repeater-get-selected-instance/29847>\
**Category:** Ignition\
**Created:** [November 11, 2019, 3:28pm UTC](https://forum.inductiveautomation.com/t/flex-repeater-get-selected-instance/29847 "2019-11-11T15:28:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [November 11, 2019, 4:31pm UTC](https://forum.inductiveautomation.com/t/flex-repeater-get-selected-instance/29847/2 "2019-11-11T16:31:03Z")

</div>

Short answer: no.  
Long answer: Don't rely on the Flex Repeater to handle this for you; let your Views do the work with Message Handlers.

Setup:  
Let the View being instanced accept a param (like `index` - this param is passed along free for all instances of the Flex Repeater without you needing to supply anything yourself).  
 ![17%20AM](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/216e2b450cf5fbd02f3734b01a6b292878c9b99a.png)

on the ROOT node of the View, configure an onClick event to execute a Script Action with the following code:

```auto
system.perspective.sendMessage('ROOTCLICK', payload={'index': self.view.params.index}, scope='page')

```

Now go to the Flex Repeater, right-click the Flex Repeater, and select "Configure Scripts...".  
Under Message Handlers, add a new handler with a message type of "ROOTCLICK", and supply the following code:

```auto
self.custom.selected = payload['index']

```

Now your Flex Repeater is aware of which instance was most recently clicked.

---

_[View the full topic](https://forum.inductiveautomation.com/t/flex-repeater-get-selected-instance/29847)._
