def updateParameters(self): """Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parmater has been changed.""" if self.params[0].altered: tblList = [" "] desc = arcpy.Describe(self.params[0].value) tblList.append(desc.name) if self.params[1].value: desc = arcpy.Describe(self.params[1].value) tblList.append(desc.name) if self.params[2].value: desc = arcpy.Describe(self.params[2].value) tblList.append(desc.name) self.params[6].filter.list = tblList self.params[8].filter.list = tblList self.params[10].filter.list = tblList if self.params[1].altered: tblList = [" "] if self.params[0].value: desc = arcpy.Describe(self.params[0].value) tblList.append(desc.name) desc = arcpy.Describe(self.params[1].value) tblList.append(desc.name) if self.params[2].value: desc = arcpy.Describe(self.params[2].value) tblList.append(desc.name) self.params[6].filter.list = tblList self.params[8].filter.list = tblList self.params[10].filter.list = tblList if self.params[2].altered: tblList = [" "] if self.params[0].value: desc = arcpy.Describe(self.params[0].value) tblList.append(desc.name) if self.params[1].value: desc = arcpy.Describe(self.params[1].value) tblList.append(desc.name) desc = arcpy.Describe(self.params[2].value) tblList.append(desc.name) self.params[6].filter.list = tblList self.params[8].filter.list = tblList self.params[10].filter.list = tblList if self.params[6].altered: "this is the point where I was wondering if I can use the Obtained from property to populate "self.params[6] with the fields for the table name selected in self.params[6] return
fldList = [f.name for f in arcpy.ListFields(params[6].value)]
def getParameterInfo(self): '''parameter definitions for GUI''' params =[] params.append(arcpy.Parameter( displayName='GPFeatureLayer1', name='GPFeatureLayer1', datatype='GPFeatureLayer', parameterType="Required", direction="Input")) params.append(arcpy.Parameter( displayName='Field1', name='Field1', datatype='Field', parameterType="Required", direction="Input")) #this will automatically update the fields list with fields from param[0] params[1].parameterDependencies = [params[0].name]