# Preserve or reimplement column settings in a table data script transform?

**URL:** <https://forum.inductiveautomation.com/t/preserve-or-reimplement-column-settings-in-a-table-data-script-transform/54993>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [January 13, 2022, 6:25pm UTC](https://forum.inductiveautomation.com/t/preserve-or-reimplement-column-settings-in-a-table-data-script-transform/54993 "2022-01-13T18:25:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [January 13, 2022, 6:25pm UTC](https://forum.inductiveautomation.com/t/preserve-or-reimplement-column-settings-in-a-table-data-script-transform/54993/1 "2022-01-13T18:25:29Z")

</div>

I have a perspective table that is populated with a named query. One column that comes through as an int had the column made to turn it into a progress bar like so  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/37fbded00399228c33bf79d492053fd8c797a82b.png)

which resulted in

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

I wanted to color the background with a transform script so I did that with the following

```auto
	import system.date
	pydset = system.dataset.toPyDataSet(value)
	returned_rows = []
	for row in pydset:
		row_dict = {}
		unStyledColumns = ["plantNumber","plantName","LocalDataTableName","LastUpdated","LastRecordDateTime","recordsPerHourAvg","LastAttemp_Status","LastUpdated_Status","LastRecordDateTime_Status"]
			
		if row['LastAttempt'] is None:
			row_dict['LastAttempt'] = {'value': row['LastAttempt'], 'style':{'classes':'TableStyles/WarningRecordCount'}}
		elif system.date.hoursBetween(row['LastAttempt'],timestamp) > 1:
			row_dict['LastAttempt'] = {'value': row['LastAttempt'], 'style':{'classes':'TableStyles/BadRecordCount'}}
		else:
			row_dict['LastAttempt'] = {'value': row['LastAttempt']}
			
		# Style Record Columns 
		recordsTotal = int(row['recordsTotal'])
		recordTotalDefault = {'value': recordsTotal}
		recordsTotalClass = None
		if recordsTotal < 5:
			recordsTotalClass = {'classes':'TableStyles/BadRecordCount'}
		elif recordsTotal < 10:
			recordsTotalClass = {'classes':'TableStyles/WarningRecordCount'}
		else:
			recordsTotalClass = {'classes':'TableStyles/GoodRecordCount'}
		recordTotalDefault['style'] = recordsTotalClass
		row_dict['recordsTotal'] = recordTotalDefault
		
		# Unstyled columns
		for column in unStyledColumns:
			row_dict[column] = {'value':row[column]}

		returned_rows.append(row_dict)
	return returned_rows

```

Although my recordsTotal column is now red, the progressBar is gone and I can’t seem to get it back. Is there a way to either have the column setting override any defaults of the script transform or is the way to inform the column its a progress bar via script transform and if so how?

If there’s a link to documentation regarding how to use script transform to set other properties like this I wouldn’t mind reading through it but I can’t find anything like that from my searches.

---

<div class="post-metadata">

**Author:** ![swolnisty](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@swolnisty](https://forum.inductiveautomation.com/u/swolnisty)\
**Post date:** [January 13, 2022, 7:50pm UTC](https://forum.inductiveautomation.com/t/preserve-or-reimplement-column-settings-in-a-table-data-script-transform/54993/2 "2022-01-13T19:50:00Z")

</div>

Try changing the column’s ‘render’ property to ‘number’ instead of ‘auto’. That resolves the issue in my case.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [January 13, 2022, 7:57pm UTC](https://forum.inductiveautomation.com/t/preserve-or-reimplement-column-settings-in-a-table-data-script-transform/54993/3 "2022-01-13T19:57:17Z")

</div>

Thank you that did it.
