# Perspective table help exporting to excel

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803>\
**Category:** Ignition\
**Created:** [December 6, 2021, 6:21pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803 "2021-12-06T18:21:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [December 6, 2021, 6:34pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/2 "2021-12-06T18:34:14Z")

</div>

```auto
component= event.source.parent.getChild("StopsData").getChild("Table")
csv = system.dataset.toCSV(component.props.data)
system.file.saveFile("myExport.csv", "csv", "Comma Separated Values")
if filePath:
  system.file.writeFile(filePath, csv)

```

system.file.saveFile is not available in a Perspective session.

Use system.perspective.download: [system.perspective.download - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/system.perspective.download)

So your new script would look like this:

```auto
component= event.source.parent.getChild("StopsData").getChild("Table")
csv = system.dataset.toCSV(component.props.data)
system.perspective.download("myExport.csv",csv)

```

To change the color of a cell specifically you need to add a transform on the data so that on the column that you want to change the cell color on is a dict object with a value and a style: [Color perspective table cell depending on value in another column - #2 by ynejati](https://forum.inductiveautomation.com/t/color-perspective-table-cell-depending-on-value-in-another-column/21791/2)  
or  
[Cell Color in Perspective Table](https://forum.inductiveautomation.com/t/cell-color-in-perspective-table/50966)

Doing this will probably impact your first question though.

What I do for almost 100% of all tables is have a custom property on the view that is a dataset/json that holds the data that I want. Then on the table I do a transform. That way if I need to export the data out I have an un-spoiled copy of the data that I can do something with.

---

_[View the full topic](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803)._
