<?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: Definition query multiple values in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468082#M36519</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to have the values in the dialog of the tool then this needs to be scripted in the tool validation. For example if you have a tool like this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FieldValuesInList01.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/41675_FieldValuesInList01.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;and the result is to print a where clause of the values like this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FieldValuesInList02.png" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/41676_FieldValuesInList02.png" style="width: 620px; height: 270px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... the code in the script would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
fc = arcpy.GetParameterAsText(0)
fld = arcpy.GetParameterAsText(1)
selvals = arcpy.GetParameterAsText(2)

lst_vals = selvals.split(';')
where = "{0} in ('{1}')".format(arcpy.AddFieldDelimiters(fc, fld), "','".join(lst_vals))

arcpy.AddMessage(where)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the validation code for the "updateParameters" function would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; def updateParameters(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """Modify the values and properties of parameters before internal
&amp;nbsp;&amp;nbsp;&amp;nbsp; validation is performed.&amp;nbsp; This method is called whenever a parameter
&amp;nbsp;&amp;nbsp;&amp;nbsp; has been changed."""
&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[1].altered:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[1]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = str(self.params[0].value)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fld = str(self.params[1].value)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_vals = list(set(r[0] for r in arcpy.da.SearchCursor(fc, (fld))))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].filter.list = lst_vals
&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the validation, when the selected field is changed and has a value, the fc name and the fld name are read and used for the search cursor to create the list of unique values. This list is assigned to the filter.list of the 3rd parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The parameters are defined as follows:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FieldValuesInList03.png" class="jive-image image-3" src="https://community.esri.com/legacyfs/online/41677_FieldValuesInList03.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;For the field you can filter the type of fields (optionally), but you will have to define "Obtained from" and select the feature layer.&lt;/P&gt;&lt;P&gt;The list of values is a Multivalue (Yes) and the filter is an empty value list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:44:43 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2021-12-11T20:44:43Z</dc:date>
    <item>
      <title>Definition query multiple values</title>
      <link>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468081#M36518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I want to create a script tool that let's the user select one or more Line ID and set a definition query and I want to choose from a list based on the Line ID field in the feature class (SetParameter?). How can I do that? Not sure if I need to append to a list and if an expression can grow or shrink depending on how many values are selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp; LineID = '0001' OR LineID = '0002'..................................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the simple (single value) version:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
Line_ID = arcpy.GetParameterAsText(0)
mxd = arcpy.mapping.MapDocument("Current")
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
layer = arcpy.mapping.ListLayers(mxd, "Lines")[0]
sc = set(r[0] for r in arcpy.da.SearchCursor(layer, "LID"))
for s in sc:
&amp;nbsp;&amp;nbsp;&amp;nbsp; where_clause = "LID = '"+Line_ID+"'"
&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.definitionQuery = where_clause
&amp;nbsp;&amp;nbsp;&amp;nbsp; ext = layer.getExtent()
&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = ext
del mxd, df, layer, sc, s&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:44:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468081#M36518</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2021-12-11T20:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Definition query multiple values</title>
      <link>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468082#M36519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to have the values in the dialog of the tool then this needs to be scripted in the tool validation. For example if you have a tool like this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FieldValuesInList01.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/41675_FieldValuesInList01.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;and the result is to print a where clause of the values like this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FieldValuesInList02.png" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/41676_FieldValuesInList02.png" style="width: 620px; height: 270px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... the code in the script would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
fc = arcpy.GetParameterAsText(0)
fld = arcpy.GetParameterAsText(1)
selvals = arcpy.GetParameterAsText(2)

lst_vals = selvals.split(';')
where = "{0} in ('{1}')".format(arcpy.AddFieldDelimiters(fc, fld), "','".join(lst_vals))

arcpy.AddMessage(where)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the validation code for the "updateParameters" function would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; def updateParameters(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """Modify the values and properties of parameters before internal
&amp;nbsp;&amp;nbsp;&amp;nbsp; validation is performed.&amp;nbsp; This method is called whenever a parameter
&amp;nbsp;&amp;nbsp;&amp;nbsp; has been changed."""
&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[1].altered:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[1]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = str(self.params[0].value)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fld = str(self.params[1].value)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_vals = list(set(r[0] for r in arcpy.da.SearchCursor(fc, (fld))))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].filter.list = lst_vals
&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the validation, when the selected field is changed and has a value, the fc name and the fld name are read and used for the search cursor to create the list of unique values. This list is assigned to the filter.list of the 3rd parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The parameters are defined as follows:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FieldValuesInList03.png" class="jive-image image-3" src="https://community.esri.com/legacyfs/online/41677_FieldValuesInList03.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;For the field you can filter the type of fields (optionally), but you will have to define "Obtained from" and select the feature layer.&lt;/P&gt;&lt;P&gt;The list of values is a Multivalue (Yes) and the filter is an empty value list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:44:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468082#M36519</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T20:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Definition query multiple values</title>
      <link>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468083#M36520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you set up the expression for the definition query?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 22:32:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468083#M36520</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2014-12-18T22:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Definition query multiple values</title>
      <link>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468084#M36521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Combing your code with my example would yield something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
fc = arcpy.GetParameterAsText(0)
fld = arcpy.GetParameterAsText(1)
lst_vals = arcpy.GetParameter(2)

where = "{0} in ('{1}')".format(arcpy.AddFieldDelimiters(fc, fld), "','".join(lst_vals))
arcpy.AddMessage(where)

mxd = arcpy.mapping.MapDocument("Current")
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
layer = arcpy.mapping.ListLayers(mxd, fc)[0] # assuming that the layer is selected from the TOC

layer.definitionQuery = where
ext = layer.getExtent()
df.extent = ext
del mxd, df, layer&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the idea is to zoom in to the selected items...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:44:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468084#M36521</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T20:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Definition query multiple values</title>
      <link>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468085#M36522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't seem to get the list values to appear after selecting a field (which are numbers stored as text). It tells me I have illegal list values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the only way I can get a field list to appear in the UI is to use a feature class data type (feature layer = nothing). I would like to use feature layer so only layers in the data frame can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have not started on the definition query part yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
fc = arcpy.GetParameterAsText(0)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
fld = arcpy.GetParameterAsText(1)
selvals = arcpy.GetParameterAsText(2)

lst_vals = selvals.split(';')&amp;nbsp; 
where = "{0} in ('{1}')".format(arcpy.AddFieldDelimiters(fc, fld), "','".join(lst_vals)) 

arcpy.AddMessage(where) &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
class ToolValidator(object):
&amp;nbsp; """Class for validating a tool's parameter values and controlling
&amp;nbsp; the behavior of the tool's dialog."""
&amp;nbsp; def __init__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """Setup arcpy and the list of tool parameters."""
&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params = arcpy.GetParameterInfo()
&amp;nbsp; def initializeParameters(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """Refine the properties of a tool's parameters.&amp;nbsp; This method is
&amp;nbsp;&amp;nbsp;&amp;nbsp; called when the tool is opened."""
&amp;nbsp;&amp;nbsp;&amp;nbsp; return
&amp;nbsp; def updateParameters(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """Modify the values and properties of parameters before internal
&amp;nbsp;&amp;nbsp;&amp;nbsp; validation is performed.&amp;nbsp; This method is called whenever a parameter
&amp;nbsp;&amp;nbsp;&amp;nbsp; has been changed."""
&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[1].altered:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[1].value:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = str(self.params[0].value)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fld = str(self.params[1].value) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_vals = list(set(r[0] for r in arcpy.da.SearchCursor(fc, (fld))))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #self.params[1].filter.list = [str(field.name) for field in arcpy.Describe(fc).fields]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].filter.list = lst_vals
&amp;nbsp;&amp;nbsp;&amp;nbsp; return
&amp;nbsp; def updateMessages(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """Modify the messages created by internal validation for each tool
&amp;nbsp;&amp;nbsp;&amp;nbsp; parameter.&amp;nbsp; This method is called after internal validation."""
&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:44:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468085#M36522</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2021-12-11T20:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Definition query multiple values</title>
      <link>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468086#M36523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;I can't seem to get the list values to appear after selecting a field (which are numbers stored as text). It tells me I have illegal list values.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;try to change the code from lines 4 - 6 into a single line, it might solve the problem with the list. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14189519626257513" jivemacro_uid="_14189519626257513"&gt;&lt;P&gt;lst_vals = arcpy.GetParameter(2)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise add a &lt;SPAN style="font-family: 'courier new', courier;"&gt;arcpy.AddMessage(lst_vals)&lt;/SPAN&gt; to the code to see what the list is like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Also the only way I can get a field list to appear in the UI is to use a feature class data type (feature layer = nothing). I would like to use feature layer so only layers in the data frame can be used.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;UL&gt;&lt;LI&gt;In the parameter definition of the tool you have to define that the field is obtained from the featurelayer:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;IMG alt="parameterdef.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/41821_parameterdef.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;A feature layer type still let's you browse for a featureclass that is not in your TOC, so this is a possible source for errors&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 01:24:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468086#M36523</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-12-19T01:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Definition query multiple values</title>
      <link>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468087#M36524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much Xander, got it to work. There were null values in a feature in my feature class which was causing the problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Idea how to clear the definition query from the UI so all the values show up the next time the user uses the tool? Would I put the code in initializeParameter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 17:30:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468087#M36524</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2014-12-22T17:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Definition query multiple values</title>
      <link>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468088#M36525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;EM&gt;InitializeParameter&lt;/EM&gt; method is not the place, I think, since at that point you don't know what the layer is that will be selected, and clearing all where clauses is not a good thing to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you will need to pump in some more code in the &lt;EM&gt;updateParameters&lt;/EM&gt; method, where you access the layer in the TOC and clear any where clause. The other option would be to determine the source of the featurelayer and access the featureclass instead of the featurelayer, since a featureclass does not have a where clause applied to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 23:44:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/definition-query-multiple-values/m-p/468088#M36525</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-12-22T23:44:40Z</dc:date>
    </item>
  </channel>
</rss>

