# Specific instance deletion in flex repeater

**URL:** <https://forum.inductiveautomation.com/t/specific-instance-deletion-in-flex-repeater/94793>\
**Category:** Ignition\
**Created:** [August 19, 2024, 6:07am UTC](https://forum.inductiveautomation.com/t/specific-instance-deletion-in-flex-repeater/94793 "2024-08-19T06:07:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hema\_T](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@Hema\_T](https://forum.inductiveautomation.com/u/Hema_T)\
**Post date:** [August 19, 2024, 6:07am UTC](https://forum.inductiveautomation.com/t/specific-instance-deletion-in-flex-repeater/94793/1 "2024-08-19T06:07:36Z")

</div>

Hi team ,  
I'm trying to delete a specific instance from a Flex Repeater, but even when I pass the index, it's deleting the last instance instead. Kindly help me in deleting the specific instance

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 19, 2024, 6:38am UTC](https://forum.inductiveautomation.com/t/specific-instance-deletion-in-flex-repeater/94793/2 "2024-08-19T06:38:13Z")

</div>

post your code, formated.

But you should probably just generate all the instances through a binding, instead of deleting one from an list.

---

<div class="post-metadata">

**Author:** ![Alexi\_Andrzejewski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alexi_andrzejewski/32/65032_2.png) [@Alexi\_Andrzejewski](https://forum.inductiveautomation.com/u/Alexi_Andrzejewski)\
**Post date:** [August 19, 2024, 6:41am UTC](https://forum.inductiveautomation.com/t/specific-instance-deletion-in-flex-repeater/94793/3 "2024-08-19T06:41:29Z")

</div>

Maybe you could use the pop() method in Jython

> **[W3Schools.com](https://www.w3schools.com/python/ref_list_pop.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

---

<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:** [August 19, 2024, 6:56am UTC](https://forum.inductiveautomation.com/t/specific-instance-deletion-in-flex-repeater/94793/4 "2024-08-19T06:56:51Z")

</div>

Rebuild the list of instances, minus the one you want to remove.

---

<div class="post-metadata">

**Author:** ![Hema\_T](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@Hema\_T](https://forum.inductiveautomation.com/u/Hema_T)\
**Post date:** [August 19, 2024, 7:47am UTC](https://forum.inductiveautomation.com/t/specific-instance-deletion-in-flex-repeater/94793/5 "2024-08-19T07:47:43Z")

</div>

Hi ,  
I have called this through message handler , and deleting the specific index

```python
	index = payload['index']
	flex = self.props.instances
	flex.pop(int(index))

```

---

<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:** [August 19, 2024, 8:13am UTC](https://forum.inductiveautomation.com/t/specific-instance-deletion-in-flex-repeater/94793/6 "2024-08-19T08:13:09Z")

</div>

And ...?  
Does it work? If it does then mark your own answer or Alexi's as "Solution",

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [August 19, 2024, 12:06pm UTC](https://forum.inductiveautomation.com/t/specific-instance-deletion-in-flex-repeater/94793/7 "2024-08-19T12:06:58Z")

</div>

I agree with @victordcq that it's generally better to build the list programmatically if the list is going to change.

You can select the base node of the flex repeater and copy and then paste into a text editor to see the json it's using. Then you can build that off a binding and a script transform.
