# Populate flexrepeater instances automatically on page load

**URL:** <https://forum.inductiveautomation.com/t/populate-flexrepeater-instances-automatically-on-page-load/108732>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [July 21, 2025, 4:20pm UTC](https://forum.inductiveautomation.com/t/populate-flexrepeater-instances-automatically-on-page-load/108732 "2025-07-21T16:20:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [July 21, 2025, 4:20pm UTC](https://forum.inductiveautomation.com/t/populate-flexrepeater-instances-automatically-on-page-load/108732/1 "2025-07-21T16:20:15Z")

</div>

I have a need to create all the plc device status for everyone to view. It can be viewed on the gateway, however I do not want to give everyone access to gateway. this is how close I got. Using this script I got all the list of devices.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/6/a606d4806a35237300eb5b7b14489f5e25216c2d.png)  
json format as below

```python
[
{'Status': u'[System]Gateway/Devices/PLC1/Connected', 
'Description': u'[System]Gateway/Devices/PLC1/Description', 
'enabledTag': u'[System]Gateway/Devices/PLC1/Enabled', 
'deviceName': u'PLC1'}
]

```

script I tried on console

```python
base_path = "[System]Gateway/Devices"
results = system.tag.browse(base_path)
device_list = []

for tag in results.getResults():
    device_name = tag['name']
    device_path = base_path + "/" + device_name

    device_list.append({
        "deviceName": device_name,
        "Description": device_path + "/Description",
        "enabledTag": device_path + "/Enabled",
        "connectedTag": device_path + "/Connected"
    })

# Assign to Flex Repeater
print device_list

```

How can I parse the list in FlexRepeater instances so as I add more devices or remove when this page is open the event script updates the list.

---

<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:** [July 21, 2025, 4:24pm UTC](https://forum.inductiveautomation.com/t/populate-flexrepeater-instances-automatically-on-page-load/108732/2 "2025-07-21T16:24:40Z")

</div>

I'm not certain I follow.

You can use a script transform on a binding for the flex repeater and programmatically build the json to create instances in your flex repeater. The binding executes when the page loads. Based on your script it would look at the tag database and make as many instances in the flex repeater as you need.

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [July 21, 2025, 4:50pm UTC](https://forum.inductiveautomation.com/t/populate-flexrepeater-instances-automatically-on-page-load/108732/3 "2025-07-21T16:50:43Z")

</div>

@Steve_Laubach  
You mean binding like this ?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/e/2ee0774c74c09a555c9d1223f69bbe86f2eacf97.png)  
Can you point me to an example please?

---

<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:** [July 21, 2025, 5:12pm UTC](https://forum.inductiveautomation.com/t/populate-flexrepeater-instances-automatically-on-page-load/108732/4 "2025-07-21T17:12:38Z")

</div>

There's a lot of ways to do it.

Bind to whatever condition you want to use to make it load content. Then use a script transform on the binding to build the json that loads instances of your view inside the flex repeater.

---

<div class="post-metadata">

**Author:** ![vtran](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vtran](https://forum.inductiveautomation.com/u/vtran)\
**Post date:** [July 21, 2025, 10:08pm UTC](https://forum.inductiveautomation.com/t/populate-flexrepeater-instances-automatically-on-page-load/108732/5 "2025-07-21T22:08:22Z")

</div>

If you only need to update the list when you open the view, then you just need to use the `onStartup` event on the root view. You can right click on `Root` \> `Configure Events`. Then add a script there

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/8/082823721ed4ba21b609452d39dc4f8bfc931ae2.png)

Then I would use your same script, but instead of printing it out, just assign it to a custom property

so replace

```python
print device_list

```

with

```python
self.view.custom.deviceList = device_list

```

Then, you can bind your flex-repeater's `instances` to `self.view.custom.deviceList`

Bonus, you can create a new script under `Root` \> `Configure Scripts` and name it `refreshDeviceList`  
then you can call it from the `onStartup` event like this

```python
self.view.rootContainer.refreshDeviceList()

```

This also allows you to create a button to call the same script to refresh your list without having to refresh the page

---

<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:** [July 21, 2025, 10:35pm UTC](https://forum.inductiveautomation.com/t/populate-flexrepeater-instances-automatically-on-page-load/108732/6 "2025-07-21T22:35:35Z")

</div>

I wouldn't use an onStartup event. I would use a binding with a script transform regardless if you want to run it on load or on change of something, as then it's directly attached to the component and is obvious. Something in an onStartup script is less obvious.

If you just want it to run once, use an expression binding and set the expression to simply `1`

> [@Anant\_Upadhyayula](#):
>
> ```python
> device_list.append({
> "deviceName": device_name,
> "Description": device_path + "/Description",
> "enabledTag": device_path + "/Enabled",
> "connectedTag": device_path + "/Connected"
> })
> 
> ```

You should just be passing the devicePath to the template views and indirectly binding to the tags you need to read from within the template views.

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [July 22, 2025, 1:36pm UTC](https://forum.inductiveautomation.com/t/populate-flexrepeater-instances-automatically-on-page-load/108732/7 "2025-07-22T13:36:07Z")

</div>

Thank you @vtran & @nminchin for your help. It worked great, now I have a beautiful table dynamically populating and giving connection status of all PLCs. However I ended up using on startup.  
@nminchin is this what you mean ? I thought transform was to modify the value. How 1 can be transformed to pull the data script ?

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

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [July 22, 2025, 2:09pm UTC](https://forum.inductiveautomation.com/t/populate-flexrepeater-instances-automatically-on-page-load/108732/8 "2025-07-22T14:09:35Z")

</div>

no worries figured it out, it was missing `return value` in the end
