<?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: Access the &amp;quot;SQL Expression&amp;quot; parameters and add custom filter lists in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331177#M68724</link>
    <description>&lt;P&gt;Here's an earlier post "Programmatically select layer definition query" found here&amp;nbsp;&lt;A title="Programmatically select layer definition query" href="https://community.esri.com/t5/arcgis-parcel-fabric-questions/programmatically-select-layer-definition-query/td-p/1114999" target="_self"&gt;https://community.esri.com/t5/arcgis-parcel-fabric-questions/programmatically-select-layer-definition-query/td-p/1114999&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See also - "Delete vs deactivate layer definition query"-&amp;nbsp;&amp;nbsp;&lt;A title="Delete vs deactivate layer definition query" href="https://community.esri.com/t5/python-questions/delete-vs-deactivate-layer-definition-query/m-p/1313695" target="_self"&gt;https://community.esri.com/t5/python-questions/delete-vs-deactivate-layer-definition-query/m-p/1313695&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Sep 2023 17:37:46 GMT</pubDate>
    <dc:creator>Shauna-RaeBrown</dc:creator>
    <dc:date>2023-09-21T17:37:46Z</dc:date>
    <item>
      <title>Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331147#M68719</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, being a beginner on arcpy and in the design of my first script tool in arcgis pro&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to know if it is possible to access the "SQL Expression" parameters with python and add lists of personalized filters in order to create personal SQL queries.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 16:35:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331147#M68719</guid>
      <dc:creator>xavro</dc:creator>
      <dc:date>2023-09-21T16:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331152#M68720</link>
      <description>&lt;P&gt;#xavro, here's a link that will get you started.&amp;nbsp;&lt;A title="Specifying a query in Python" href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/specifying-a-query.htm" target="_self"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/specifying-a-query.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 16:40:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331152#M68720</guid>
      <dc:creator>Shauna-RaeBrown</dc:creator>
      <dc:date>2023-09-21T16:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331158#M68721</link>
      <description>&lt;P&gt;A technique I used early on when I was learning about using Python with ArcGIS was to run the tool and, from the Geoprocessing History panel, drag the process to the Python window. This showed me all the parameters that had been used on that run and how they were formatted.&lt;/P&gt;&lt;P&gt;The ultimate source for seeing how the code should be used is the arcpy Python documentation.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/searchcursor-class.htm" target="_blank"&gt;SearchCursor—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 16:50:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331158#M68721</guid>
      <dc:creator>JeffreyMitzelfelt</dc:creator>
      <dc:date>2023-09-21T16:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331171#M68723</link>
      <description>&lt;P&gt;Thank you for your answers, but I think we misunderstood or maybe it's me...but the goal is to modify the list of filters available in the "SQL expression" tool. see my screenshot.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xavro_0-1695316112606.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/81319i5237D09FA195367A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xavro_0-1695316112606.png" alt="xavro_0-1695316112606.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 17:08:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331171#M68723</guid>
      <dc:creator>xavro</dc:creator>
      <dc:date>2023-09-21T17:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331177#M68724</link>
      <description>&lt;P&gt;Here's an earlier post "Programmatically select layer definition query" found here&amp;nbsp;&lt;A title="Programmatically select layer definition query" href="https://community.esri.com/t5/arcgis-parcel-fabric-questions/programmatically-select-layer-definition-query/td-p/1114999" target="_self"&gt;https://community.esri.com/t5/arcgis-parcel-fabric-questions/programmatically-select-layer-definition-query/td-p/1114999&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See also - "Delete vs deactivate layer definition query"-&amp;nbsp;&amp;nbsp;&lt;A title="Delete vs deactivate layer definition query" href="https://community.esri.com/t5/python-questions/delete-vs-deactivate-layer-definition-query/m-p/1313695" target="_self"&gt;https://community.esri.com/t5/python-questions/delete-vs-deactivate-layer-definition-query/m-p/1313695&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 17:37:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331177#M68724</guid>
      <dc:creator>Shauna-RaeBrown</dc:creator>
      <dc:date>2023-09-21T17:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331185#M68725</link>
      <description>&lt;P&gt;See also:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/select-layer-by-attribute.htm" target="_blank"&gt;Select Layer By Attribute (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 17:37:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331185#M68725</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-09-21T17:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331203#M68727</link>
      <description>&lt;P&gt;Thank you, but I know and have already seen everything relating to layer definition requests. The purpose of this tool is to have the possibility of carrying out searches on attributes common to several layers and then defining definition queries on the corresponding layers.&lt;/P&gt;&lt;P&gt;I would like to use &lt;STRONG&gt;&lt;EM&gt;initializeParameters(self):&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to populate my filter lists.&lt;BR /&gt;A bit like we can do in a “Chaine” data type via &lt;STRONG&gt;&lt;EM&gt;self.params[3].filter.list = category&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 18:03:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331203#M68727</guid>
      <dc:creator>xavro</dc:creator>
      <dc:date>2023-09-21T18:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331207#M68729</link>
      <description>&lt;P&gt;It may be better if you posted some sort of sample code so we can figure out exactly what you're trying for.&lt;/P&gt;&lt;P&gt;I think, though, that you should investigate updateParameters() to change your filter list.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 18:17:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331207#M68729</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-09-21T18:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331214#M68730</link>
      <description>&lt;P&gt;You have to set the dependency of the Sql Expression parameter to a layer/feature class parameter:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1695320456016.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/81327iCC1F3CD740CCA08A/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1695320456016.png" alt="JohannesLindner_0-1695320456016.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then it will grab the possible fields and values from that parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without a selected layer:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1695320511918.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/81328iE8F9B10FE5CBEB23/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1695320511918.png" alt="JohannesLindner_1-1695320511918.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With a selected layer:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_2-1695320549075.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/81329i83BCD621509443E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_2-1695320549075.png" alt="JohannesLindner_2-1695320549075.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 18:22:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331214#M68730</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-09-21T18:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331220#M68732</link>
      <description>&lt;P&gt;Thanks, but is it possible to edit or create these fields/value without feature layer dependencies ?&lt;/P&gt;&lt;P&gt;With&amp;nbsp;&lt;SPAN&gt;updateParameters()&amp;nbsp; or&amp;nbsp;initializeParameters() ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 18:30:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331220#M68732</guid>
      <dc:creator>xavro</dc:creator>
      <dc:date>2023-09-21T18:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331232#M68733</link>
      <description>&lt;P&gt;No. The SQL Expression parameter requires a dependency.&lt;/P&gt;&lt;P&gt;You don't have to set that dependency in the parameter editor. You can also use the parameter.parameterDependencies property in the validation:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;class ToolValidator:
    def __init__(self):
        self.params = arcpy.GetParameterInfo()

    def updateParameters(self):
        self.params[1].parameterDependencies = ["layer"]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But for the tool to fill out the lists of field names and values, the parameter needs a dependency.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't want to do it that way, you could use a string parameter. Users can then simply input their query (or you can prepare a dropdown).&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 19:26:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1331232#M68733</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-09-21T19:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Access the "SQL Expression" parameters and add custom filter lists</title>
      <link>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1332931#M68763</link>
      <description>&lt;P&gt;Thanks, I was able to access all my settings and do my search tasks while running the script. However, for each value change in my searches, I would like to delete my previous query definition, can I do that?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 14:22:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-the-quot-sql-expression-quot-parameters-and/m-p/1332931#M68763</guid>
      <dc:creator>xavro</dc:creator>
      <dc:date>2023-09-27T14:22:29Z</dc:date>
    </item>
  </channel>
</rss>

