GetParameterAsText - List of Value

09-25-2014 08:38 PM
New Contributor



I want to define a list of values for a Parameter as all the values for a particular field in a Feature Class.


How do I do that?

0 Kudos
2 Replies
Occasional Contributor III

Hi Mitt,

I doubt you can define a parameter as values in a field. You can pass a shapefile and field as input parameter.

Refer this blog Create a list of unique field values | ArcPy Café  , get a list of values in your script and loop through the values.

MVP Honored Contributor

You should be able to use Tool Validation for this. Also, see here for a working example, employing an arcpy.da.SearchCursor.