Powertable Export

Hi there,

I setup PowerTable displaying a logged set of integers from a transaction group, each set of integers has a specific meaning, I managed to display the description of these integers instead of just the integer itself in the powertable using configureCell script function, using following code:

	reason_id = [
		0,
		10,
		11,
		...
		]

	reason_text =[
		"0 - NO SELECTION",
		"10 - COLOUR - TOO DARK",
		"11 - COLOUR - TOO LIGHT",
		...

	array_count=len(reason_id)

	for x in range(0,array_count):
		if colName == 'Reason' and value == reason_id[x]:
			return {'text' : reason_text[x]}

However when using the export to excel function, I still get the raw data from the dataset, rather than what is displayed. Is there an easy way to export the “displayed” data rather than the “raw” data ?

Logging the values as strings into the database is not an option unfortunately.

This is my button script that exports the data to excel;

table = event.source.parent.getComponent("Power Table")
dataDS = table.data
data = system.dataset.toPyDataSet(dataDS)
system.dataset.exportExcel("ScrapLog",1, data)

Is it possible to replace the raw data on “Reasons” column before exporting to excel to get the same results as what is displayed on the power table?

Try: dataDS = table.viewDataset

That worked! Thanks Jordan! a lot easier than what I had in mind!

1 Like