I'm attempting to create a python toolbox script that geocodes a CSV. It will be my version of the Geocode Addresses tool. What do I need to do to get the Field parameter to accept the 'ADDRESS' field of my CSV? Right now, the 3rd param accepts a Field datatype. I didn't see a good option in parameter controls either. If i run this tool as is I receive errors. Two of the errors mention needing an output parameter, which I'll get to. I'm assuming Error 000800 is referring to the Field parameter, but beyond that I don't really know. Maybe it's in the script itself.

class GeocodeFile:
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Geocode File"
self.description = "Geocodes a local file and saves it back to the same directory."
self.params = arcpy.GetParameterInfo()
def getParameterInfo(self):
"""Define the tool parameters."""
# 1st param
param0 = arcpy.Parameter(
displayName="Your CSV",
name="your_csv",
datatype="DEFile",
parameterType='Required',
direction='Input'
)
# 2nd param
param1 = arcpy.Parameter(
displayName="Geocoder",
name='geocoder',
datatype="DEAddressLocator",
parameterType='Required',
direction='Input'
)
# 3rd param
param2 = arcpy.Parameter(
displayName="Field",
name='fields',
datatype="Field",
parameterType='Required',
direction='Input',
)
# param2.controlCLSID = '{172840BF-D385-4F83-80E8-2AC3B79EB0E0}'
# param2.value="ADDRESS"
params = [param0,param1,param2]
return params
def isLicensed(self):
"""Set whether the tool is licensed to execute."""
return True
def updateParameters(self, parameters):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def execute(self, parameters, messages):
"""The source code of the tool."""
import arcpy
arcpy.geocoding.GeocodeFile(
in_table=parameters[0].valueAsText,
locator=parameters[1].valueAsText,
address_fields=parameters[2].valueAsText,
output_type=parameters[0].valueAsText,
# output_location=r"C:\Users\test",
# output_name="geocodedfile",
# country=None,
# location_type="ROUTING_LOCATION",
# category=None,
# output_fields="ALL"
)
return
def postExecute(self, parameters):
"""This method takes place after outputs are processed and
added to the display."""
return
