<?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: Using Validator Class updateParameter Function to Change Parameter Datatype in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-validator-class-updateparameter-function-to/m-p/30720#M2454</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks again Jason and I was afraid I had to do that, although it's not a terrible work around. I'll take what I can get!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, I attempted to make this happen and I am banging my head against the wall. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can set the default values in the updateParameter with no issue. It's when I set the updates after the user has changed the parameter value. In my if/else statements, I am setting a condition on the value sitting in the first parameter (params[0]). The script isn't picking up the value at all, even though I set it in as a default value. It goes something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;I set the script below, save and close the validator script.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Open the tool and the parameter is set to "DatabaseConnections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW" as I expected&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The second parameter is empty as expected&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The third parameter is populated with the fields from the default parameter, even though I set an "not in list" condition in the final if/else statement which means the third condition "not in list" is being satisfied, even though the default value I set at the beginning is sitting inside the list....(I've also tried a &amp;lt;&amp;gt; and a simple else&amp;nbsp; with the same outcome)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;BR /&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; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set Parameters #1 and 2 default values
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not self.params[0].altered:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[0].value = r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW"
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not self.params[1].altered:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].value = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not self.params[2].altered:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].value = ""

&amp;nbsp;&amp;nbsp;&amp;nbsp; # if the user changes Parameter #1, then update the datatype and values
&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[0].value == r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].value = "SITE_NUMBER = "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].enabled = False
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif self.params[0].value == r"Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.list = "SITE_NUMBER = "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].enabled = False
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif self.params[0].value not in [r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW", r"Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW"]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].datatype = "String"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; descFields = arcpy.Describe(self.params[0].value).fields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.list = [field.name for field in descFields]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.values = self.params[1].filter.list&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is weird. I created an updateMessage to spit out the value to see if I am missing something and it returns exactly what I set the parameter to NOT look for:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[0].value not in ["Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW", ""Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW""]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[0].setErrorMessage(self.params[0].value)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This line returns &lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt; which is exactly what I told it NOT to do in &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if self.params[0].value not in ["Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW", ""Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW""]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh and get this, I even did:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[0].value &amp;lt;&amp;gt; self.params[0].value:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[0].setErrorMessage(self.params[0].value)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And I get an error message. I told it that if it didn't equal itself, then set a message. See, I'm stumped.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried setting the string path to raw string and then a none raw string. Same thing. The "value" property is supposed to be of type "Value Object". I don't know what that means, but maybe it means it will pick up the datatype of the parameter as a "Value Object"? The parameter datatype for the first param (param[0]) is of type "Feature Class", so is it not picking up the string as a feature class? Am I explaing my problem properly?? ha! Ughhh....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:14:22 GMT</pubDate>
    <dc:creator>MikeMacRae</dc:creator>
    <dc:date>2021-12-10T21:14:22Z</dc:date>
    <item>
      <title>Using Validator Class updateParameter Function to Change Parameter Datatype</title>
      <link>https://community.esri.com/t5/python-questions/using-validator-class-updateparameter-function-to/m-p/30718#M2452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am building an ArcGIS gui that takes 4 parameters:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;An input feature class or shapefile&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;A parameter to query on the input feature class or shapefile&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;A predefinied multivalue list of layer names that the user can choose from&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;An output folder location to print out an excel file&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;SPAN&gt;The tool will clip data from any of the layers choosen in Parameter #3 based on the input feature class or shapefile (clip feature) from Parameter #1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the user chooses a feature class as an input, it is know that there are only 2 to choose from ("AREA1", "AREA2"). They will use Parameter 2 to Query a record from which ever feature class they choose. (eg "SITE_NUMBER" = 10023) Also, I know that these 2 feature classes contain the same list of fields, so I can code this into the underlying python script to write the names of particular ones I want to the resultant excel spreasheet. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the user chooses a shapefile, it could be one of several hundred. Each shapefile only has one record (polygon) so I do not need them to query on a feature using an SQL Query. However, each shapefile does not have the same list of fields from one to the next. In this case, instead of having Parameter #2 of datatype "SQL Expression", I would like to dynamically change the datatype, using the updateParameter function in the Validator Class, to string and a multivalue filter of field names from the shapefile to which the user can choose from.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the following script, I have attempted to set the some default values for Parameters #1 and 2. dayatype on Parameter #2 if the user changes the input value for Parameter #1. For the programmers out there, this obviously doesn't work as it is a read only parameter according to the help docs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00150000000v000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00150000000v000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
# Set Parameters #1nad 2 default values
if not self.params[0].altered:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[0].value = r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW"
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not self.params[1].altered:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].datatype = "SQL Expression"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].value = ""

&amp;nbsp;&amp;nbsp;&amp;nbsp; # if the user changes Parameter #1, then update the datatype and values
&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[0].value == r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].datatype = "SQL Expression"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].value = "SITE_NUMBER = "
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif self.params[0].value == r"Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].datatype = "SQL Expression"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.list = "SITE_NUMBER = "
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif self.params[0].value not in [r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW", r"Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW"]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].datatype = "String"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; descFields = arcpy.Describe(self.params[0].value).fields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.list = [field.name for field in descFields]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.values = self.params[1].filter.list&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There seems to be a way to set the parameter datatype on the Parameter object, but I'm not sure how to pass that from getParameterInfo function into the updateParameter function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001500000035000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//001500000035000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been playing around with a bunch of approaches, but none seem to work. So, for what I tried to outline as my outcome above....is what I am trying to do possible?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:14:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-validator-class-updateparameter-function-to/m-p/30718#M2452</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2021-12-10T21:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using Validator Class updateParameter Function to Change Parameter Datatype</title>
      <link>https://community.esri.com/t5/python-questions/using-validator-class-updateparameter-function-to/m-p/30719#M2453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can't change a parameter's datatype, period. What you want to accomplish is best done by having two parameters, one a SQL Expression and one a String, and enabling/disabling one or the other in the validation code based on the first parameter's value.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 21:09:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-validator-class-updateparameter-function-to/m-p/30719#M2453</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2014-04-02T21:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using Validator Class updateParameter Function to Change Parameter Datatype</title>
      <link>https://community.esri.com/t5/python-questions/using-validator-class-updateparameter-function-to/m-p/30720#M2454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks again Jason and I was afraid I had to do that, although it's not a terrible work around. I'll take what I can get!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, I attempted to make this happen and I am banging my head against the wall. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can set the default values in the updateParameter with no issue. It's when I set the updates after the user has changed the parameter value. In my if/else statements, I am setting a condition on the value sitting in the first parameter (params[0]). The script isn't picking up the value at all, even though I set it in as a default value. It goes something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;I set the script below, save and close the validator script.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Open the tool and the parameter is set to "DatabaseConnections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW" as I expected&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The second parameter is empty as expected&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The third parameter is populated with the fields from the default parameter, even though I set an "not in list" condition in the final if/else statement which means the third condition "not in list" is being satisfied, even though the default value I set at the beginning is sitting inside the list....(I've also tried a &amp;lt;&amp;gt; and a simple else&amp;nbsp; with the same outcome)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;BR /&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; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set Parameters #1 and 2 default values
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not self.params[0].altered:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[0].value = r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW"
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not self.params[1].altered:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].value = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not self.params[2].altered:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].value = ""

&amp;nbsp;&amp;nbsp;&amp;nbsp; # if the user changes Parameter #1, then update the datatype and values
&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[0].value == r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].value = "SITE_NUMBER = "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].enabled = False
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif self.params[0].value == r"Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.list = "SITE_NUMBER = "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].enabled = False
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif self.params[0].value not in [r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW", r"Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW"]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].datatype = "String"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; descFields = arcpy.Describe(self.params[0].value).fields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.list = [field.name for field in descFields]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.values = self.params[1].filter.list&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is weird. I created an updateMessage to spit out the value to see if I am missing something and it returns exactly what I set the parameter to NOT look for:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[0].value not in ["Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW", ""Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW""]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[0].setErrorMessage(self.params[0].value)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This line returns &lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt; which is exactly what I told it NOT to do in &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if self.params[0].value not in ["Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW", ""Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW""]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh and get this, I even did:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[0].value &amp;lt;&amp;gt; self.params[0].value:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[0].setErrorMessage(self.params[0].value)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And I get an error message. I told it that if it didn't equal itself, then set a message. See, I'm stumped.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried setting the string path to raw string and then a none raw string. Same thing. The "value" property is supposed to be of type "Value Object". I don't know what that means, but maybe it means it will pick up the datatype of the parameter as a "Value Object"? The parameter datatype for the first param (param[0]) is of type "Feature Class", so is it not picking up the string as a feature class? Am I explaing my problem properly?? ha! Ughhh....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:14:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-validator-class-updateparameter-function-to/m-p/30720#M2454</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2021-12-10T21:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Validator Class updateParameter Function to Change Parameter Datatype</title>
      <link>https://community.esri.com/t5/python-questions/using-validator-class-updateparameter-function-to/m-p/30721#M2455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Problem solved. I needed to set the conditional sentence to equal the string format of the input parameter. I think this is because I set the datatype to "Feature Class". I tested this by changing the datatype to string and my original validator worked. So, when setting conditions on non string datatype parameters, do something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # if the user changes Parameter #1, then update the datatype and values
&amp;nbsp;&amp;nbsp;&amp;nbsp; if &lt;STRONG&gt;str&lt;/STRONG&gt;(self.params[0].value) == r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].value = "SITE_NUMBER = "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].enabled = False
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif &lt;STRONG&gt;str&lt;/STRONG&gt;(self.params[0].value) == r"Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.list = "SITE_NUMBER = "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].enabled = False
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif &lt;STRONG&gt;str&lt;/STRONG&gt;(self.params[0].value) not in [r"Database Connections\CONNECT1.sde\AREA1_SPATIAL.ER_SVW", r"Database Connections\CONNECT1.sde\AREA2_SPATIAL.ER_SVW"]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].datatype = "String"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; descFields = arcpy.Describe(self.params[0].value).fields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.list = [str(field.name) for field in descFields]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].filter.values = self.params[1].filter.list&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:14:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-validator-class-updateparameter-function-to/m-p/30721#M2455</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2021-12-10T21:14:25Z</dc:date>
    </item>
  </channel>
</rss>

