AnsweredAssumed Answered

Python Toolbox: Validating derived parameters for Model Builder

Question asked by yogip933 on Jul 7, 2015
Latest reply on Jul 7, 2015 by FGibson-esristaff

I'm working on a tool in a Python toolbox and I'm running into trouble getting the output tables to work in Model Builder.

 

The tool takes an input table view and ultimately uses the Table Select (Analysis) tool to save two new tables, based on different SQL queries, into the geodatabase. I thought setting the Parameter Dependencies to the input table would be a good start, but that just set the output tables to updated versions of the input, not two new tables.

 

How I do validate Output table 1 and 2 so that they show up as two new tables in Model Builder but have all the fields of the input table?

 

def getParameterInfo(self):
        """Define parameter definitions"""
        workspace = arcpy.Parameter(
            displayName = "Geodatabase",
            name = "gdb",
            datatype = "DEWorkspace",
            parameterType = "Required",
            direction = "Input")
        workspace.defaultEnvironmentName = "workspace"

#     Input Table
 param1 = arcpy.Parameter(
            displayName = "Input Feature",
            name = "in_feature",
            datatype = "GPTableView",
            parameterType = "Required",
            direction = "Input"
            )

#      Output Table 1
        param7 = arcpy.Parameter(
            displayName = "GEOCODE Table",
            name = "geocode_table",
            datatype = "DETable",
            parameterType = "Derived",
            direction = "Output")

#      Output Table 2
        param8 = arcpy.Parameter(
            displayName = "FLAGGED Table",
            name = "flagged_table",
            datatype = "DETable",
            parameterType = "Derived",
            direction = "Output")

 

Please let me know if any additional information is required. I'm using 10.2.2 Advanced if that matters.

Outcomes