AnsweredAssumed Answered

How do I get list of fields from feature class/shapefile using tool?

Question asked by iggz on May 15, 2013
Latest reply on May 15, 2013 by ttruong
I'm making a custom tool that will allow the user to make many different changes to the fields of a chosen feature class or shapefile.

Part of my code is:

fc = arcpy.GetParameterAsText(0)


And then when I create the tool parameters I choose the Data Type as Data Element.

The next input I get from the user is the field from the fc that they want to use to copy data from into a new field.

copy_field = arcpy.GetParameterAsText(1)


For this parameter I've tried Field, Field Info and Field Mappings but none of them give me the fields of the inputted fc.

How can I link this parameter to the first one to give me a list of the fields within the fc?

Outcomes