# What dictates the ordering of the "column attributes" data set for a given table?

**URL:** <https://forum.inductiveautomation.com/t/what-dictates-the-ordering-of-the-column-attributes-data-set-for-a-given-table/21121>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [November 28, 2018, 8:55pm UTC](https://forum.inductiveautomation.com/t/what-dictates-the-ordering-of-the-column-attributes-data-set-for-a-given-table/21121 "2018-11-28T20:55:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bankeny2](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bankeny2](https://forum.inductiveautomation.com/u/bankeny2)\
**Post date:** [November 28, 2018, 8:55pm UTC](https://forum.inductiveautomation.com/t/what-dictates-the-ordering-of-the-column-attributes-data-set-for-a-given-table/21121/1 "2018-11-28T20:55:06Z")

</div>

I have a table that is updated when a window is opened. I have also written some logic to enable/disable column editing for a set of specified columns in the table. It seems to work (partially). However it does not update the expected columns. I ended up discovering that the column order in my table did not match the ordering of the columns as listed in the “Column Attributes Data” data set. Why would the ordering of these not match?

The ordering of my table is as follows (this is the desired order):  
Channel  
Descr  
Min  
Max  
Value  
Active  
ModID  
PointNo  
TagPath

The ordering of the “Column Attributes Data” data set is:  
ModID  
Active  
Channel  
PointNo  
Min  
Value  
Max  
Descr  
TagPath

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [November 28, 2018, 9:57pm UTC](https://forum.inductiveautomation.com/t/what-dictates-the-ordering-of-the-column-attributes-data-set-for-a-given-table/21121/2 "2018-11-28T21:57:44Z")

</div>

I really have no idea what sets that order, but a workaround for what you are doing would be to throw then in a dictionary and then reference them.

```auto
table = event.source.parent.getComponent('Power Table')
tempDict = {}
colData = table.columnAttributesData
i=0
ds = system.dataset.toPyDataSet(colData)
for row in ds:
	tempDict[row[0]]=i
	i+=1
newData = system.dataset.setValue(colData,tempDict['TagPath'],'editable',1)
table.columnAttributesData=newData

```

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [November 29, 2018, 1:22am UTC](https://forum.inductiveautomation.com/t/what-dictates-the-ordering-of-the-column-attributes-data-set-for-a-given-table/21121/3 "2018-11-29T01:22:52Z")

</div>

Why don’t you use the isCellEditable extension function?

---

<div class="post-metadata">

**Author:** ![bankeny2](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bankeny2](https://forum.inductiveautomation.com/u/bankeny2)\
**Post date:** [November 30, 2018, 3:59pm UTC](https://forum.inductiveautomation.com/t/what-dictates-the-ordering-of-the-column-attributes-data-set-for-a-given-table/21121/4 "2018-11-30T15:59:28Z")

</div>

> [@jpark](#):
>
> sCellEditable

Thank you jpark. That is certainly an option for updating individual cell attributes in a power table. However, my application is not currently using a power table for this set of components. Also for this particular situation, I would prefer updating the column attributes over iterating through all of the cells in each table.

---

<div class="post-metadata">

**Author:** ![bankeny2](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bankeny2](https://forum.inductiveautomation.com/u/bankeny2)\
**Post date:** [November 30, 2018, 4:07pm UTC](https://forum.inductiveautomation.com/t/what-dictates-the-ordering-of-the-column-attributes-data-set-for-a-given-table/21121/5 "2018-11-30T16:07:34Z")

</div>

Thank you MMaynardUSG. This sounds like a good workaround option. I was just hoping that maybe it was caused but something that I have done so as to avoid putting in extra logic that may be unnecessary.
