astones Posted Friday at 11:31 AM Share Posted Friday at 11:31 AM Hi, I have a very simple script which runs when a document property is changed. properties = { “X”: “resultsX”, “Y”: “resultsY”, “Z”: “resultsZ”, } for field, property in properties.items(): Document.Properties[property] = field if Document.Properties[“results”] == field else "Placeholder" The problem is that for security reasons, IronPython scripts will not run in Spotfire Cloud, which is what we have. Is there another way to reproduce this functionality, e.g. by using TERR? Thanks! Adam Link to comment Share on other sites More sharing options...
barchiel33 Posted Friday at 12:44 PM Share Posted Friday at 12:44 PM (edited) Hello @astones! You're able to run data functions in your Spotfire Cloud instance? If so, it's pretty simple... if you have a static set of document properties to watch. If you have a dynamic set of document properties (for instance, if sometimes it's three, but other times it's four), it's a bit trickier. Assuming static, your R data function would have a set of input and output parameters (one for each of the X, Y, Z properties). The function itself would be something like this: for (i in seq(1, 3)){ chkVal <- get(paste0("inProp", i)) if (resProp == chkVal){ assign(paste0("outProp", i), chkVal) } else { assign(paste0("outProp", i), "Placeholder") } } resProp is an input parameter for your Document.Properties["results"], chkVal gets set to your input document properties. You can expand the list of document properties by adding additional input and output parameters and adjusting the first line of the script. In the seq(1, 3) bit, just change 3 to whatever number of properties. Edited Friday at 12:45 PM by barchiel33 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now