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

Just use this simple Python function:

def has_visualization(page_name, vis_name):
    for page in Document.Pages:
        if page.Title == page_name:
            for vis in page.Visuals:
                if vis.Title == vis_name:
                    return True

Try it:

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

Spotfire Visualization


See more about Spotfire on Blogger Xantorohara, 2017-08-30, Spotfire 7.8.0


© 2017 Xantorohara