spotfiresoftware / spotfire-mods

Spotfire® Mods
https://spotfiresoftware.github.io/spotfire-mods/
Other
54 stars 41 forks source link

How do I get the table data from spotfire through mods #137

Closed xiaoping1993 closed 4 months ago

xiaoping1993 commented 4 months ago

Recently we wanted to create a custom component using the spotfire mods component I have a problem during this period I wanted to get all the table data from spotfire in the mods development environment because I needed this interaction to display the table data, I know there is a method in Mods to get all tables(mod.document.tables), but I can't figure out how to get the row data for a particular table can you help me? thanks

objerke commented 4 months ago

The visualization mods API does not support accessing a table's underlying rows directly. The API currently allows one aggregated data view of the visualization's main data table. The main table can be set from the Spotfire UI or programmatically by the mod itself via mod.visualization.setMainTable("tableName").

If you feel this is not enough, feel free to file an idea in the Spotfire ideas portal.

xiaoping1993 commented 4 months ago

Hi objerke thanks for your reply I wondered if there was another way to achieve what I wanted: was there an api that would interact with spotfire document attributes, ironPython scripts, etc., to get what I wanted

objerke commented 4 months ago

You can use iron python to read data from embedded data tables. Help on how to do that can be asked in the Spotfire community. Here is a starting point https://community.spotfire.com/articles/spotfire/how-to-retrieve-table-column-values-in-spotfire-using-ironpython-scripting/

Good luck!