Python toolbox choosing the correct data type for my parameters

3450
1
Jump to solution
11-23-2015 03:15 AM
BenjaminSimpson
New Contributor III

Hi,

I am in the process of converting a python script into a python toolbox. The input for my toolbox is either one or more personal geodatabases. Data from these geodatabases is then appended to an Oracle database. The question I have is I am unsure what data type I am suppose to use for my input. I have not seen anything that jumps out at me as the correct data type to use for selecting geodatabases. The only one that I thought might be correct is the 'Database Connection' data type.

Could someone please clarify which data type I should be selecting for this input parameter?

Thanks in advance for any help.

Ben.

0 Kudos
1 Solution

Accepted Solutions
Luke_Pinner
MVP Regular Contributor

Use a Workspace datatype - DEWorkspace

You can limit the Workspace types allowed with a parameter filter.

Something like:

def getParameterInfo(self):
    param0 = arcpy.Parameter(
        displayName="Input GDB",
        name="in_gdb",
        datatype="DEWorkspace​",
        parameterType="Required",
        direction="Input")

    param0.filter.type = "Workspace​"
    param0.filter.list = ["Local Database"]

    return [param0, other params etc...]

View solution in original post

1 Reply
Luke_Pinner
MVP Regular Contributor

Use a Workspace datatype - DEWorkspace

You can limit the Workspace types allowed with a parameter filter.

Something like:

def getParameterInfo(self):
    param0 = arcpy.Parameter(
        displayName="Input GDB",
        name="in_gdb",
        datatype="DEWorkspace​",
        parameterType="Required",
        direction="Input")

    param0.filter.type = "Workspace​"
    param0.filter.list = ["Local Database"]

    return [param0, other params etc...]