30 August, 2017

Check that Spotfire document has a Visualization on a Page using Python

Check that Spotfire document has a Visualization on a Page using Python

Just use this simple Python function:

def hasVisualization(pageName, visName):
    for page in Document.Pages:
        if page.Title == pageName:
            for vis in page.Visuals:
                if vis.Title == visName:
                    return True

Try it:

print(hasVisualization("SomePage", "SomeChart")) # True
print(hasVisualization("SomePage", "ChartNotExists")) # None

Spotfire Visualization

See more about Spotfire internals on GitHub

Xantorohara, 2017-08-30, Spotfire 7.8.0

No comments: