In my custom Python toolbox, I would like to create a similar input parameter as the "Input KML File" in the "KML To Layer" tool, i.e. allowing a layer to be selected by dropdown and by opening it from a file dialog (see screenshot below).
I can almost make this work by using the following code:
param0 = arcpy.Parameter(
displayName="Input KML/KMZ File",
name="input_kml",
datatype=["GPKMLLayer","DEFile"],
parameterType="Required",
direction="Input",
)
The problem is that I now get the choose any file type instead of just kml and kmz files.
If I add the following code, I get an error:
param0.filter.list = ["kml", "kmz"]
How can I make this work?