Importing CSV in table component Ignition Perspective

I can import csv in table for vision but same procedure i followed in perspective, not successful

If you can show us the script you are using we can help.

Probably only slight changes are really needed to make what works in vision work in perspective.

3 Likes

path = system.file.openFile(“csv”)
stringData = system.file.readFileAsString(path)
data = system.dataset.fromCSV(stringData)
event.source.parent.getComponent(‘Table’).data = data

These parts are specific to Vision.

Unlike a vision client, Perspective does not have access to the clients file system. You will need to either place the file somewhere that the Gateway can access and run this script in gateway scope, or you will need to use a file upload component to prompt the user to upload the file.

Also, perspective accesses components differently than vision. The easiest way is to use the property selector in the top right corner of the dialog to select the component and property you want. I would expect it to look something like

self.getSibling('Table').data
2 Likes

Use the </> button to format code in your posts.

Thanks…its working…
i used code below.
filename = event.file.name
fileBytes = event.file.getBytes()
fileString = event.file.getString()
data = system.dataset.fromCSV(fileString)
self.getSibling(“Table”).props.data = data