Jump to content
  • How to set search expression for a ListBoxFilter in Spotfire® Using IronPython Scripting


    This article shows how to set search expression for a ListBoxFilter in Spotfire® Using IronPython Scripting

    Introduction

    At times when a list box filter contains a lengthy list of values and multiple values need to be searched instead of typing each value manually these can be taken as an input from a document property which can be dynamically modified as required.

    Code sample

    # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Application.Filters import ListBoxFilter,FilterTypeIdentifiers
    
    myPanel=Document.ActivePageReference.FilterPanel
    myFilter=myPanel.TableGroups[0].GetFilter("Country")
    
    listBoxFilter=myFilter.FilterReference.As[ListBoxFilter]()
    listBoxFilter.IncludeAllValues=False
    listBoxFilter.SearchExpression ='(India)or(USA)or(UK)'
    
    #(India)or(USA)or(UK) search expression can be set in a string document property and set in the SearchExpression.
     

    References

     

    License:  TIBCO BSD-Style License

    Back to IronPython Scripting in Spotfire Examples:  https://community.spotfire.com/s/article/IronPython-Scripting-in-Spotfire

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...