1

I have a script loaded as a toolbox into ArcGIS Pro. It has two multi-value string parameters.

Is there a way to restrict the second parameter's list against the first?

For example, if a user picks "New Jersey" from the first list, their options would be restricted to "North" or "South." But if they chose "New York" then instead the second parameter would list "Long Island", "Bronx", and "Manhattan."

As I currently have it, there's just a long list in the second parameter and its not linked to or associated with the first. I'd prefer to have this as one tool rather than create multiple nearly identical tools for different regions of a business.

1 Answer 1

3

To do this I think you should investigate using a Filter class:

The filter object allows you to specify the choices available for a parameter.

On that page of the documentation there is:

An example where the value list filter in the second parameter changes based on the shape type found in the first parameter, a feature class.

You could adjust that code to be an example where the value list filter in the second parameter changes based on the value chosen in the first parameter.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.