I have tried to write some validation code for a script in ArcGIS. This validation code more or less repeats what the script itself does, which is a simple cutting up of a long string by using the Python "split" string method, and then using each of the outcomes to define some parameters. This works great for most variables here, but for some reason the params 2 and 6 are being set to the full original string when I review the validation results in the ModelBuilder window by hovering over the variable. I have no idea why this is happening. Both of these parameters are defined as String output on the script. There is one more string output variable here (params 8), that displays a good value, and the only difference I see is the extra "replace". I have even tried to hard code the values for params 2 and 6, by setting it directly equivalent to a string, but to no avail, it still showed the full original unsplitted string.
What am I missing?
def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
self.params[1].value = self.params[0].value.split(';')[0]
self.params[2].value = self.params[0].value.split(';')[1]
self.params[3].value = self.params[0].value.split(';')[2]
self.params[4].value = self.params[0].value.split(';')[3]
isExportFeatureClassStr = self.params[0].value.split(';')[4]
if isExportFeatureClassStr == "True":
isExportFeatureClass = True
flowControlBoolean = False
else:
isExportFeatureClass = False
flowControlBoolean = True
self.params[5].value = isExportFeatureClass
self.params[6].value = self.params[0].value.split(';')[5]
self.params[7].value = flowControlBoolean
self.params[8].value = self.params[0].value.split(';')[6].replace(",",";")
return