Jump to content
We've recently updated our Privacy Statement, available here. ×

Run Data Functions in a Certain Order

Paul Victor 2

Recommended Posts

Is there a script that can run Data Functions in a specific order I have 8 different Data Functions that all keep trying to run at the same time, so I was wondering if there was a Python script or something that tells Spotfire to run Data Functions one at a time.

I've looked here,https://d2wh20haedxe3f.cloudfront.net/sites/default/files/wiki_files/top..., and they show the script

for df in Document.Data.DataFunctions:

if df.Name == "K-means clustering":


but I'm not too sure how to implement it.

Link to comment
Share on other sites

By default, data functions run asynchronously. Other actions may be performed while the data function executes. A data function can however be executed synchronously within an IronPython script by using the method DataFunction.ExecuteSynchronously(). Execution of the remainder of the IronPython script is then blocked until the data function completes. You can use nested for loop for defining order in which you want to run your data function in Python script.

Suppose you have three data functions,you can run them in order as sample below where order is defined by value of i:


while i

Link to comment
Share on other sites

  • 1 year later...

getting AttributeError: 'DataManager' object has no attribute 'datafunctions'.


and then if i change it to while i <Document.Data.DataFunctions.count:


i get AttributeError: 'DataFunctionCollection' object has no attribute 'count'


But needing to run some data functions in a specific order so any help is appreciated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...