# Table Data Issues

**URL:** <https://forum.inductiveautomation.com/t/table-data-issues/24443>\
**Category:** Ignition Early Access\
**Created:** [April 27, 2019, 11:14pm UTC](https://forum.inductiveautomation.com/t/table-data-issues/24443 "2019-04-27T23:14:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![WildeKurt](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@WildeKurt](https://forum.inductiveautomation.com/u/WildeKurt)\
**Post date:** [April 27, 2019, 11:14pm UTC](https://forum.inductiveautomation.com/t/table-data-issues/24443/1 "2019-04-27T23:14:11Z")

</div>

When binding a table to a query and selecting a return format of json it returns a very simple object as opposed to what’s eluded to in the manual (i.e. a dictionary with keys value, editable and style). In my attempts to transform the simple json I’ve run into a couple of issues:

1. If the query returns a null, the value displayed in the table is a string representing the whole dictionary. If I put a value in the db table, it returns what’s expected.

2. The order of the columns returned doesn’t seem to be that of the query. The following script transforms a returned dataset to a list of dicts. but the column order is different than what’s expected. If I set the return format to json, the column order is correct.

```auto
	# convert incoming dataset to a list of dict
	editableCols = []
	ds = value
	colNames = ds.getColumnNames()
	d = []
	for i in range(ds.rowCount):
		rowDict = {}
		for col in colNames:
			editable = False
			if col in editableCols:
				editable = True
			rowDict[col] = {"value":ds.getValueAt(i,col),"editable":editable}
		d.append(rowDict)
	return d

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 28, 2019, 12:36pm UTC](https://forum.inductiveautomation.com/t/table-data-issues/24443/2 "2019-04-28T12:36:58Z")

</div>

> [@WildeKurt](#):
>
> but the column order is different than what’s expected.

That's undoubtedly a side effect of python/jython not retaining dictionary entries in the order added. Consider using python's json module to directly build your object.
