# Creating dynaming instances in flex repeater

**URL:** <https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [March 9, 2022, 3:30am UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994 "2022-03-09T03:30:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vani161998](https://avatars.discourse-cdn.com/v4/letter/v/ee7513/32.png) [@vani161998](https://forum.inductiveautomation.com/u/vani161998)\
**Post date:** [March 9, 2022, 3:30am UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/1 "2022-03-09T03:30:56Z")

</div>

hi,  
I want to create and delete dynamic text filed as a instances in flex repeater using script .Also want to store that value as a dataset.

i tried with message handler but i don’t know what message to send as a trigger point.

any suggestions pls?

---

<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:** [March 9, 2022, 8:52am UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/2 "2022-03-09T08:52:51Z")

</div>

I’m not sure I understand.  
You want to use a text field as the repeated view of a flex repeater, each of those having a dynamic value ? And store those values as a dataset ? Is that correct ?

In any case, my first question would be: What is the end goal ?  
second question: How are the values computed ?

---

<div class="post-metadata">

**Author:** ![vani161998](https://avatars.discourse-cdn.com/v4/letter/v/ee7513/32.png) [@vani161998](https://forum.inductiveautomation.com/u/vani161998)\
**Post date:** [March 9, 2022, 11:31am UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/3 "2022-03-09T11:31:52Z")

</div>

your understanding is correct.

My requirement is having the text field as dynamic not only the values .

My end goal will be if I have certain conditions according to that instances should change dynamically …for example if i want only 10 text field, i should have only 10 text field in my view. Next time the condition changes. i should also want to delete the instances i need.

i hope you understand my question.

---

<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:** [March 9, 2022, 12:22pm UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/4 "2022-03-09T12:22:25Z")

</div>

Can you explain what will determine the number of instances, and then what should happen individual instances ? I’m not sure what you mean by ‘dynamic text field’.

Having a dynamic number of instances is easy enough, all you need to do is bind the `instances` property of the flex repeater against whatever will determine the number of instances, and process this to return an array dicts containing the params required by the instanced view.

Then, the content of the instances can be determined there and passed as params. The binding can be reevaluated to change the params, and this change the content of the instances.  
If this is not acceptable, messages can be used, with a handler configured on the instanced view. You’ll have to find a way to identify each instance, so that only the right one processes the message. This could be done by passing an id as parameter to each instance, and matching that id in a parameter of the message’s payload.

If you can be more specific about what you’re working with, someone around here will probably have a better answer.

---

<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:** [March 9, 2022, 1:19pm UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/5 "2022-03-09T13:19:17Z")

</div>

If you only need textfields, it might be interesting to look into the table component.With editable columns you basicly have a texfield “repeater”

---

<div class="post-metadata">

**Author:** ![vani161998](https://avatars.discourse-cdn.com/v4/letter/v/ee7513/32.png) [@vani161998](https://forum.inductiveautomation.com/u/vani161998)\
**Post date:** [March 10, 2022, 3:05am UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/6 "2022-03-10T03:05:24Z")

</div>

To be more precise i want my instances to increase and decrease using a script when i click a button.

---

<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:** [March 10, 2022, 9:22am UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/7 "2022-03-10T09:22:23Z")

</div>

Okay, but what do you want to do ? What’s the goal ? We still don’t know what goes in the making of your text field array or what it should be in the end. Maybe it’s session specific, maybe it’s global, maybe the text fields should be already filled from existing data… etc. Those are not just details.

A simple table might as suggested by victor might be enough, though I seem to always have issues with editable table…

---

<div class="post-metadata">

**Author:** ![tupanaster](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tupanaster](https://forum.inductiveautomation.com/u/tupanaster)\
**Post date:** [April 11, 2022, 11:37am UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/8 "2022-04-11T11:37:22Z")

</div>

From other posts:  
[Dynamic Flex Repeater - dataset binding with instances](https://forum.inductiveautomation.com/t/dynamic-flex-repeater-dataset-binding-with-instances/37930)

[Dynamic Flex Repeater Instances](https://forum.inductiveautomation.com/t/dynamic-flex-repeater-instances/30472)

> [@pascal.fragnoud](#):
>
> an array dicts containing the params required by the instanced view

I've noticed that when I'm adding instances manually the parameters doesn't sync automatically. Is that an issue when adding a parameter by code?

---

<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:** [April 11, 2022, 5:36pm UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/9 "2022-04-11T17:36:33Z")

</div>

What do you mean ? I’ve never noticed that…

---

<div class="post-metadata">

**Author:** ![tupanaster](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tupanaster](https://forum.inductiveautomation.com/u/tupanaster)\
**Post date:** [April 11, 2022, 6:07pm UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/10 "2022-04-11T18:07:54Z")

</div>

I have 2 params:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/92ecc95231ad0657d6ed50f131e7d52a12d15264.png)

I grab a Flex Repeater, add a path and an instance  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/3/b32823dae4245e155c62169c1634c36e9a26c168.png)

Since I get no parameters I have to add them manually.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/6/865b71ebfe636c6bef4d90225b0e83647c63e474.png)

Now I have them  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/3/53bcc9a0394d8cb4a86bf90ab6363a4554f1887d.png)

I was wondering if that’s an issue when adding instances by script?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 11, 2022, 6:31pm UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/11 "2022-04-11T18:31:51Z")

</div>

When adding instances by script you will need to add any parameters that are needed in the script. In my experience this still works as expected. The Sync Params buttons are really just a short cut to help you not have to add the parameters one by one.

---

<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:** [April 11, 2022, 7:28pm UTC](https://forum.inductiveautomation.com/t/creating-dynaming-instances-in-flex-repeater/56994/12 "2022-04-11T19:28:45Z")

</div>

> [@tupanaster](#):
>
> I was wondering if that’s an issue when adding instances by script?

Well you'll have to build an array of dicts, each containing the required parameters, there's no way around that. There's no issue here.
