Search code examples
pythonspotfire

Spotfire updating data on demand table


I need to update a data on demand data table on spotfire. Is there a way to do it over script? I have looked into multiple pages to use the refresh function, but it doesn't seem to work either through the script or when I do it manually through the data table properties. Here are the links that i looked at:

Spotfire: Create button to start loading data ,instead of using load data on demand

https://datashoptalk.com/trigger-on-demand-queries-ironpython/

https://community.tibco.com/wiki/how-refresh-or-reload-data-using-ironpython-script-tibco-spotfire.

Here is my code that I used, in case I am missing something.

from Spotfire.Dxp.Data import DataManager,DataTable
from Spotfire.Dxp.Application.Scripting import ScriptDefinition
from System.Collections.Generic import Dictionary,List
from System.Collections import ArrayList
from Spotfire.Dxp.Framework.ApplicationModel import NotificationService
import clr

table=List[DataTable]()
table.Add(Document.Data.Tables["test"])
Document.Data.Tables.Refresh(table)

The version of spotfire that I am using is 7.11. The main issue that the selection on the main data table does not affect the data on demand tables at all. Thank you


Solution

  • So, I am not sure if this was updated in future versions, but I got a response from the company saying that mine would not be able to do it. The way I got around it was creating a marking that was only being used to update the data on demand tables from the original table. I then created a script to update these markings to match the marking that I was using normally. This way you can still mark things on the table and then have a button that will update the data on demand tables individually. It is important that each data on demand table gets its own marking that will be updated through the script.