# Add Flex Instances on addition of new row in Database

**URL:** <https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205>\
**Category:** Ignition\
**Created:** [February 16, 2022, 1:36pm UTC](https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205 "2022-02-16T13:36:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sourabh\_Ambildhuke](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Sourabh\_Ambildhuke](https://forum.inductiveautomation.com/u/Sourabh_Ambildhuke)\
**Post date:** [February 16, 2022, 1:36pm UTC](https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205/1 "2022-02-16T13:36:18Z")

</div>

Hi team,

New to perspective and stuck on challenge so can anyone has done this previously.  
I want to add Flex repeater instance when a new row is added in the database and show data in flex repeater parameters. is it possible through binding or we need to write script for the same.

if anyone wants more clarification will share the screenshot also.

Regards  
Sourabh A

---

<div class="post-metadata">

**Author:** ![jonathan.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jonathan.taylor/32/4048_2.png) [@jonathan.taylor](https://forum.inductiveautomation.com/u/jonathan.taylor)\
**Post date:** [February 16, 2022, 2:43pm UTC](https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205/2 "2022-02-16T14:43:54Z")

</div>

By ‘stuck on challenge’ do you mean a challenge from the Inductive University? Or from a certification test?

If it is from a Certification test, you cannot ask for help from the forums.

---

<div class="post-metadata">

**Author:** ![Sourabh\_Ambildhuke](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Sourabh\_Ambildhuke](https://forum.inductiveautomation.com/u/Sourabh_Ambildhuke)\
**Post date:** [February 16, 2022, 2:46pm UTC](https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205/3 "2022-02-16T14:46:29Z")

</div>

Hi @jonathan.taylor thanks for the reply.

But it is not for any sort of test i have a task in a project to build the about mentioned function but i am not sure about that. Nothing else.

Regards  
Sourabh A

---

<div class="post-metadata">

**Author:** ![jonathan.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jonathan.taylor/32/4048_2.png) [@jonathan.taylor](https://forum.inductiveautomation.com/u/jonathan.taylor)\
**Post date:** [February 16, 2022, 2:56pm UTC](https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205/4 "2022-02-16T14:56:21Z")

</div>

Alrighty then

You will most likely need to bind initially to a named query that retrieves the relevant data, then use a script transform to format that data into the structure required by the flex repeater and the view’s required parameters. You would have to have this poll the data frequently to get the most up to date data.

Your script tranform might look something like this, where your parameters are different:

```auto
array = []
for i in value:
	array.append({'param1':i['param1'],'param2':'Something',"instanceStyle": {"classes": ""}, "instancePosition": {}})
return array

```

A more efficient way would be to trigger a poll on change (refresh the binding), but it really depends on where that new row in the database table is coming from - if it is within the project you could use messaging to update it.

---

<div class="post-metadata">

**Author:** ![Sourabh\_Ambildhuke](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Sourabh\_Ambildhuke](https://forum.inductiveautomation.com/u/Sourabh_Ambildhuke)\
**Post date:** [February 17, 2022, 9:29am UTC](https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205/5 "2022-02-17T09:29:31Z")

</div>

Thanks @jonathan.taylor i will try this later the day as i dont have access to oracle db rightnow.  
Only one thing i want to point out is we have 10column and i want to have data of only 4 column to display on flex repeater so i have to write the column name in the script and parameters or other.

Regards  
Sourabh A

---

<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:** [February 17, 2022, 10:44am UTC](https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205/6 "2022-02-17T10:44:37Z")

</div>

Write your query to only fetch the 4 columns you’re interested in. No point in querying the whole thing then use only 4 tenth of it.

---

<div class="post-metadata">

**Author:** ![Tamilvanan\_S](https://avatars.discourse-cdn.com/v4/letter/t/ecae2f/32.png) [@Tamilvanan\_S](https://forum.inductiveautomation.com/u/Tamilvanan_S)\
**Post date:** [February 12, 2024, 9:35am UTC](https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205/7 "2024-02-12T09:35:46Z")

</div>

Hi,  
I have table component in view. I want to create the dynamic rows in single table component. And I have to create a multiple table component using flex repeater. but all table component row s are changing based on Tags.. kindly provide me help.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/e/2eaa113a6749a9924b989667d099f1277bc0499a.png)

---

<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:** [February 12, 2024, 9:44am UTC](https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205/8 "2024-02-12T09:44:09Z")

</div>

To be clear:  
You want to repeat a view that contains a table, and each table will display tag data ?

Can you be more specific about the tags structure/hierarchy ?  
Do you need the values to refresh ? How often ?

---

<div class="post-metadata">

**Author:** ![Tamilvanan\_S](https://avatars.discourse-cdn.com/v4/letter/t/ecae2f/32.png) [@Tamilvanan\_S](https://forum.inductiveautomation.com/u/Tamilvanan_S)\
**Post date:** [February 12, 2024, 9:52am UTC](https://forum.inductiveautomation.com/t/add-flex-instances-on-addition-of-new-row-in-database/56205/9 "2024-02-12T09:52:02Z")

</div>

if I Selected One Folder. Press the ok button. Two tables need to be created one is Two and second one is a Three. This Two table contains two tags (New Tag, Three) and Three table contains one tag(New Tag). likewise i need  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/4/d45ba1713f9978c2cec428795c959c271924903e.png)
