0

I'm setting up parameters in a Python Toolbox and have a Value Table with three columns. Two of the columns have value lists for the user to pick from. I would like for the user to be able to choose one, but leave the other Null. However, the tool will throw and error message that Null is not part of the value list and the tool will not run. If I try adding Null to the value list, the parameters break and do not show when the tool is opened. Is there a way to a user to pick a value from one column in a value table parameter, but leave the another blank?

Here is my code for my value table parameter:

target_elements = arcpy.Parameter(
    displayName = "Target Element(s) Name",
    name = "element_name",
    datatype = "GPValueTable",
    parameterType = "Optional",
    multiValue = True,
    direction = "Input")
target_elements.columns = [['GPString','Target Element Type'],['GPString','Target Element'],['GPString','EO ID (if known)']]
target_elements.filters[0].list = ["Insect","Lepidoptera","Other Invertebrate","Plant","Vertebrate Animal","Community"]
target_elements.filters[1].list = et_list
3
  • 1
    Have an 'Unknown' value?
    – user2856
    Commented Feb 26, 2020 at 21:20
  • Having an 'Unknown' value is not really an option because that would be misleading that they found something that was unknown, instead of just not finding anything. I guess I could have a 'None' option, but would have to handle that and change to a null value later in the script.
    – mmoore
    Commented Feb 27, 2020 at 21:50
  • I've tried and there is no way other than having some sort of placeholder value ('None', 'Unknown', "Whatever You want...'). You can't have an empty string, but you can use a single space so it looks blank.
    – user2856
    Commented Feb 27, 2020 at 22:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.