Jump to content

IronPython script to get cell value I click on from graphical table


achen1

Recommended Posts

Hello I have a graphical table that contains two columns; "Parameter" and "Value"

Parameter Value
A 100
A 200
A 300
B 100
B 200

How can I to use the "Perform action on click" feature and IronPython to extract the cell value from the "Parameter" column based on the row the user clicks on.

Link to comment
Share on other sites

Hi achen1,

With the script provided in this article, you can 'push' a marked value to a document property (and then have it displayed in a label property for example): 

.

There are some caveats though. The example works for columns in a data table. Assuming your graphical table is as stated above, your Value column has to been added to the data table so you can pick it up. A 'normal' calculated value will not be recognized by the script, so you have to replicate it in the Data Table first (note that I had to set the context for my calculated value, otherwise it sums the whole column...):
image.thumb.png.b518feb71c165187d9d870d6fe8eb587.png

 

Once you have the script working, you can then set the perform action on click by applying the script to it. Make sure you use iron python 2.7 as I got an error using iron python 3.4.
And if you're already on the latest version of Spotfire, you should also be able to use this solution in an action mod script.

Kind regards,

David

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...