title: Spotfire Apply Multi-select values from a property control to a filter using a script
body: <p>I'm trying to figure out how to allow the user to select multiple values from a Property Control, and have those values passed to a filter. </p>
  
  <p>The filtering needs to be conditional for two different related tables, so I have to use a list box tied to a property control, and handle the filtering with a script. </p>
  
  <p>I have a current working version that allows for only one selection, but I need to be able to select multiple. </p>
  
  <p>Two tables filtered with All option selected
  <a href="https://i.stack.imgur.com/Cqqk4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cqqk4.jpg" alt="enter image description here"></a></p>
  
  <p>Two tables filtered with 1 program selected
  <a href="https://i.stack.imgur.com/qmQqr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qmQqr.jpg" alt="enter image description here"></a></p>
  
  <p>The script I'm using to filter by 1 selection at a time is:</p>
  
  <pre><code> from Spotfire.Dxp.Application import Filters from
   Spotfire.Dxp.Application.Filters import CheckBoxFilter
  
   Filter1=Document.FilteringSchemes[0].Item[myDataTable].Item[myDataTable.Columns.Item["Program_Name"]].As[CheckBoxFilter]()
   Filter2=Document.FilteringSchemes[0].Item[myDataTable2].Item[myDataTable2.Columns.Item["Program_Name"]].As[CheckBoxFilter]()
  
   program=Document.Properties["SelectedProgram"]
  
   Filter1.IncludeEmpty = False  for value in Filter1.Values:  
   Filter1.Uncheck(value)
  
   Filter2.IncludeEmpty = False for value in Filter2.Values:  
   Filter2.Uncheck(value)
  
   if program == "All":   Filter1.Check(program)  Filter2.IncludeEmpty =
   False  for value in Filter2.Values:        Filter2.Check(value) if program
   &lt;&gt; "All":  Filter1.Check(program)  Filter2.Check(program)
  </code></pre>