Select to view content in your preferred language

How to set the filter for a multiValue DEFile parameter in getParameterInfo so that browse dialog respects it?

481
0
02-27-2018 12:47 PM
JacquesBeaurain
Occasional Contributor

This is probably be a bug but wondering if anyone knows how to work around it? A parameter defined as follows

def getParameterInfo(self):
    in_files = arcpy.Parameter(displayName="Text Files",
                               name="in_files",
                               datatype="DEFile",
                               parameterType="Required",
                               direction="Input",
                               multiValue=True)
    in_files.filter.list = ['txt']

Will not pass the filter to the browse UI, e.g.:

This is the desired result and what is shown with multiValue=True removed:

Curiously the filter still gets applied with multiValue=True during validation:

The issue is exacerbated by the fact that the validation is not extremely useful since it does not tell you which parameter has the wrong type and the file edits are scrolled left so in most cases the root directory is the only thing visible (had to manually scroll each parameter in screencap above).

0 Replies