Select to view content in your preferred language

How to use attributes from specified field as input parameter list

3208
11
03-11-2024 12:01 AM
Labels (3)
LindsayRaabe_FPCWA
MVP Regular Contributor

I swear I've seen this done before, but can't for the life of me figure out how to do it or find it again. I want to set a model builder input parameter to return all the values in a specified field of a set layer as the choice list. This way, as the layer grows and more values are added, it will give you the option to select a value and run a tool using that value as a filter for other layers that are related to it. This also removes the need to manually type in a value, reducing human error. 

I've seen the critique of this elsewhere advising against it because of the potential for huge lists, but in this situation, it won't be an issue. Obviously I want distinct values - not repeats of values if they occur more than once. I thought I'd seen it done with a Collect Values loop of sorts with the input variables of a selection tool. 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
11 Replies
LindsayRaabe_FPCWA
MVP Regular Contributor

Ahhh - I see what you were trying to achieve. Not quite what I'm looking for. That Filter list you have created is static. It will only change if you open the Model Properties > parameters and update the list manually. I want the list to be generated dynamically depending on the values from a specified field in a feature class or table. For example, my feature class has a list of plantations. I want to be able to process data on one plantation selected from the list. Over time, more plantations are added to the feature class, but the list won't update to reflect that unless I do so manually. Not ideal when I'm building models for lots of different business units and the data changes regularly. 

Side note - that video you linked to is a great video though. I hadn't seen it before so will try watch it through to see what else I might be able to learn. 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
GeorgiaLeonard
Emerging Contributor

Ohhh, I see the difference between our objectives now. If I stumble on something, I'll be sure to pass it on. Good luck!

0 Kudos