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.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Dec 9, 2021 at 19:33

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.

answered Dec 9, 2021 at 21:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.