<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Filter Lists on Parameters Python Toolbox in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/filter-lists-on-parameters-python-toolbox/m-p/566899#M44399</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the Info!!! That worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Dec 2015 16:31:20 GMT</pubDate>
    <dc:creator>MatthewRusso</dc:creator>
    <dc:date>2015-12-29T16:31:20Z</dc:date>
    <item>
      <title>Filter Lists on Parameters Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/filter-lists-on-parameters-python-toolbox/m-p/566897#M44397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For some reason I am running into an issue on a filter list for my tool box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #66d9ef; font-style: italic;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #a6e22e;"&gt;getParameterInfo&lt;/SPAN&gt;(&lt;SPAN style="color: #fd971f; font-style: italic;"&gt;self&lt;/SPAN&gt;)&lt;SPAN style="color: #f92672;"&gt;:
&lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #577550;"&gt;"""Define parameter definitions"""
&lt;/SPAN&gt;&lt;SPAN style="color: #577550;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #80807f;"&gt;prod &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #ae81ff;"&gt;\\&lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;hqstore\geostore\Software\Scripts\Python_Toolbox\ConnectionFiles\PRODUCTION_10.2.2_GISUser_Default.sde"
&lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #80807f;"&gt;test &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #ae81ff;"&gt;\\&lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;hqstore\geostore\Software\Scripts\Python_Toolbox\ConnectionFiles\Test_10.2.2_GISUser_Default.sde"
&lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #80807f;"&gt;dev &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #ae81ff;"&gt;\\&lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;hqstore\geostore\Software\Scripts\Python_Toolbox\ConnectionFiles\Dev_10.2.2_GISUser_Default.sde"
&lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;from_database &lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;arcpy.Parameter(
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #fd971f; font-style: italic;"&gt;displayName &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"From Database"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #fd971f; font-style: italic;"&gt;name &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"From_Database"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #fd971f; font-style: italic;"&gt;datatype &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"DEWorkspace"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #fd971f; font-style: italic;"&gt;parameterType &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"Required"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #fd971f; font-style: italic;"&gt;direction &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"Input"&lt;/SPAN&gt;)

&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #6de151;"&gt;#from_database.filter.type = "ValueList"
&lt;/SPAN&gt;&lt;SPAN style="color: #6de151;"&gt;&amp;nbsp; #from_database.filter.list = [prod, test]
&lt;/SPAN&gt;&lt;SPAN style="color: #6de151;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #6de151;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;to_database &lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;arcpy.Parameter(
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #fd971f; font-style: italic;"&gt;displayName &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"To Database"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #fd971f; font-style: italic;"&gt;name &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"To_Database"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #fd971f; font-style: italic;"&gt;datatype &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"DEWorkspace"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #fd971f; font-style: italic;"&gt;parameterType &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"Required"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #fd971f; font-style: italic;"&gt;direction &lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #e6db74;"&gt;"Input"&lt;/SPAN&gt;)

&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #6de151;"&gt;#to_database.filter.type = "ValueList"
&lt;/SPAN&gt;&lt;SPAN style="color: #6de151;"&gt;&amp;nbsp; #to_database.filter.list = [test, dev]
&lt;/SPAN&gt;&lt;SPAN style="color: #6de151;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #6de151;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background-color: #472c47;"&gt;parameters&lt;/SPAN&gt; &lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;[from_database&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;to_database]
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #66d9ef; font-style: italic;"&gt;return &lt;/SPAN&gt;&lt;SPAN style="background-color: #3c3c57;"&gt;parameters&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas why this is not working? the filters are commented out... so my tool works &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Ignore my spacing it is just how the copy paste ended up &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:25:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/filter-lists-on-parameters-python-toolbox/m-p/566897#M44397</guid>
      <dc:creator>MatthewRusso</dc:creator>
      <dc:date>2021-12-12T00:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Lists on Parameters Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/filter-lists-on-parameters-python-toolbox/m-p/566898#M44398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error you're seeing is expected. When using a parameter of type workspace the only filter values that you can use are to filter the type of workspace supplied (i.e. File System, Local Database, or Remote Database).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll want to use a parameter type that allows you to have a dropdown with known paths, such as GPString.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is documented on the following page and holds true for both script tools and python toolboxes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Defining parameters in a Python toolbox&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/defining-parameters-in-a-python-toolbox.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/defining-parameters-in-a-python-toolbox.htm"&gt;http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/defining-parameters-in-a-python-toolbox.htm&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG __jive_id="162027" alt="parameter.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/162027_parameter.png" style="width: 620px; height: 469px;" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Setting script tool parameters (Script tool equivalent to the above documentation)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/setting-script-tool-parameters.htm#GUID-3CB5FAF4-43DD-4C84-8AFE-08039A72B3E0" title="http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/setting-script-tool-parameters.htm#GUID-3CB5FAF4-43DD-4C84-8AFE-08039A72B3E0"&gt;http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/setting-script-tool-parameters.htm#GUID-3CB5FAF4-43DD-4C84-8AFE-08039A72B3E0&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** Screenshot of filters that become available in the UI against a parameter of type DEWorkspace. **&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="filter.png" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/162028_filter.png" style="height: auto;" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Dec 2015 23:20:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/filter-lists-on-parameters-python-toolbox/m-p/566898#M44398</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-12-28T23:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Lists on Parameters Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/filter-lists-on-parameters-python-toolbox/m-p/566899#M44399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the Info!!! That worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2015 16:31:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/filter-lists-on-parameters-python-toolbox/m-p/566899#M44399</guid>
      <dc:creator>MatthewRusso</dc:creator>
      <dc:date>2015-12-29T16:31:20Z</dc:date>
    </item>
  </channel>
</rss>

