TIBCO IronPython Scripting and Automation 1 — Questions and Answers
Question 1: What language is used for scripting automation directly within TIBCO Spotfire analyses?
- JavaScript
- IronPython (Correct answer)
- R
- Lua
Correct answer: IronPython
Spotfire uses IronPython (.NET implementation of Python 2.7) as its built-in scripting language for automating analysis behavior.
Question 2: In Spotfire IronPython, which object represents the entire current analysis document?
- Application
- Document (Correct answer)
- Analysis
- Workbook
Correct answer: Document
The 'Document' object is the root of the Spotfire object model, giving scripts access to pages, visualizations, data tables, and settings.
Question 3: Which Spotfire IronPython namespace provides access to data table filtering?
- Spotfire.Dxp.Application
- Spotfire.Dxp.Data (Correct answer)
- Spotfire.Dxp.Framework
- Spotfire.Dxp.Visualization
Correct answer: Spotfire.Dxp.Data
The Spotfire.Dxp.Data namespace contains classes for accessing and manipulating data tables, columns, rows, and filters.
Question 4: In Spotfire IronPython, how do you retrieve a data table named 'Sales' from the document?
- Document.Data.Tables('Sales') (Correct answer)
- Document.Data.Tables['Sales']
- Document.GetTable('Sales')
- Document.Data.GetTable('Sales')
Correct answer: Document.Data.Tables('Sales')
The DataTableCollection indexer uses parentheses in IronPython: Document.Data.Tables('Sales') retrieves the named table.
Question 5: What does the 'Application.GetService()' method provide in Spotfire IronPython scripting?
- Calls an external REST API
- Retrieves a server-side service instance such as DocumentService or AnalysisApplication (Correct answer)
- Gets the current user's license type
- Returns the Spotfire version number
Correct answer: Retrieves a server-side service instance such as DocumentService or AnalysisApplication
GetService() is used to obtain instances of Spotfire service interfaces, enabling access to server and analysis services from scripts.
Question 6: In Spotfire IronPython, which method applies a row filter to limit visible data in a visualization?
- Document.ActivePageReference.Visuals[0].SetFilter()
- Document.Data.Filterings.DefaultFilteringScheme.Item[table][column] (Correct answer)
- Document.FilterRows()
- Visualization.ApplyRowSelection()
Correct answer: Document.Data.Filterings.DefaultFilteringScheme.Item[table][column]
Filters are accessed via the filtering scheme: Document.Data.Filterings.DefaultFilteringScheme provides the filter collection for each table and column.
What language is used for scripting automation directly within TIBCO Spotfire analyses?