# How to edit Tab strip's tab data property value using script

**URL:** <https://forum.inductiveautomation.com/t/how-to-edit-tab-strips-tab-data-property-value-using-script/10879>\
**Category:** General Discussion\
**Created:** [December 7, 2015, 9:03am UTC](https://forum.inductiveautomation.com/t/how-to-edit-tab-strips-tab-data-property-value-using-script/10879 "2015-12-07T09:03:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlaki](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@dlaki](https://forum.inductiveautomation.com/u/dlaki)\
**Post date:** [December 7, 2015, 9:03am UTC](https://forum.inductiveautomation.com/t/how-to-edit-tab-strips-tab-data-property-value-using-script/10879/1 "2015-12-07T09:03:05Z")

</div>

Hi Guys,

Can anyone help me on how can I edit the Tab Strip’s tab data property value via scripting?  
I’m thinking to create a Client event script that will edit the value (dataset) of the tab data property of a tab strip component. What I’m trying to do is to hide the tabs that will not be used for a specific client/user.  
I saw that it’s possible to hide the tabs by accessing the tab data property value and find the row of the tab you want to hide, then under hidden column just tick it. But I want to do this in script.  
Anyone knows how to do it?

See attached file for additional information.

Hope you can help me with this guys.

Thanks in advance.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/88de8ca7250c478549e5afcff8b40250d21fadb3.jpg)

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [December 7, 2015, 1:55pm UTC](https://forum.inductiveautomation.com/t/how-to-edit-tab-strips-tab-data-property-value-using-script/10879/2 "2015-12-07T13:55:14Z")

</div>

You have to edit the dataset.

`tabToHide = "Tab 3"
ts = event.source.parent.getComponent('Tab Strip')
ds = ts.tabData
for row in range(ds.rowCount):
    if ds.getValueAt(row, "NAME") == tabToHide:
        ds = system.dataset.updateRow(ds, row, {"HIDDEN": True})
        break
ts.tabData = ds`

Note that normally modifying a set that you are iterating through is a very bad idea and will almost always cause unintended results but in this case I am exiting the loop immediately after modifying the dataset.

---

<div class="post-metadata">

**Author:** ![dlaki](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@dlaki](https://forum.inductiveautomation.com/u/dlaki)\
**Post date:** [December 7, 2015, 11:00pm UTC](https://forum.inductiveautomation.com/t/how-to-edit-tab-strips-tab-data-property-value-using-script/10879/3 "2015-12-07T23:00:49Z")

</div>

@JGJohnson

Thanks, I’ll try it. Will this script also work when I put it in Client Event Script?  
This is where I want to put it.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/39e550a1d842a14c55aa947dceeeed16665b7d36.jpg)

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [December 7, 2015, 11:24pm UTC](https://forum.inductiveautomation.com/t/how-to-edit-tab-strips-tab-data-property-value-using-script/10879/4 "2015-12-07T23:24:43Z")

</div>

I don’t know if it would work or not (my guess is not) but I would recommend putting it in the internalFrameActivated event of the window that contains the tab strip.

I’m guessing you probably have a client tag that you use to determine if the tab should be hidden or not. You can read the value of that tag in the event and run the script if appropriate.
