I am writing a python script within an ArcGIS toolbox (not a Python Toolbox), that takes as input, a multivalue parameter of feature classes from which I would like to populate a second parameter with a drop down list of fields from the first feature class in the multivalue list. When using a single feature class as input, the field parameter can simply be set using the "Obtained from" functionality in the "Parameters" tab, but not so with a multivalue input. I am attempting to perform the operation using the validation classes instead. Below is my attempt using the "updateParameters" class. The validation doesn't fail, but doesn't produce a list of fields as expected. Any thoughts?
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.""" if self.params.value: self.params.filter.list = arcpy.ListFields(self.params.valueAsText.split(";")) return
Edit - I’ve also tried:
[f.name for f in arcpy.ListFields(self.params.valueAsText.split(";"))]
With no success