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[0].value:
self.params[1].filter.list = arcpy.ListFields(self.params[0].valueAsText.split(";")[0])
return
Edit - I’ve also tried:
[f.name for f in arcpy.ListFields(self.params[0].valueAsText.split(";")[0])]
With no success