HOW TO

Control the default values for a multivalue input parameter within a Python script-based tool

Last Published: October 1, 2025

Summary

Instructions provided on how to use the ToolValidator class to populate default values into the tool dialog for a script-based tool.

Procedure

Using the initializeParameters and updateParameters methods, the default values for a mutivalue parameter can be created and controlled.

  1. To add custom behavior for your script tool, right-click the script tool, click Properties, then click the Validation tab. On the Validation panel, you can provide Python code that implements a Python class named ToolValidator.

    [O-Image]
  2. In the Python editor, edit the initializeParameters method code block to create a filter list of acceptable values for the corresponding parameter:

    [O-Image]
  3. To make some or all of the filter list values selected by default, pass in a string, separated by semicolons into the parameter:

    [O-Image]
  4. The result of the edited ToolValidator class is a parameter that is updated and set upon opening of the script tool dialog:

    [O-Image]

Article ID: 000011291

Software:
  • ArcMap

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options