My goal is to grab a bunch of feature classes, select the first feature class, list the fields, and return that list to parameter 1 as a filtered list.
My ArcGIS toolbox is setup with 2 parameters.
The first parameter is a multivalue featureclass
The second parameter is a string with filter set to: "Value List" which is empty. I'm hoping to populate this. When I run the following code:
def updateParameters(self): if self.params.value: #when user inputs feature classe(s) fcs = self.params.value.value # getting list of fcs as string? spl = fcs.split(";") #splitting list of fcs fields = arcpy.ListFields(spl) #getting list of fields from 1st featureclass self.params.filter.list = fields #return list of fields to param 1
When I input the fcs into param 0, I get this error:
ERROR updateParameters Execution Error: Runtime error : 'ValueTable' object has no attribute 'value'