Select to view content in your preferred language

ModelBuilder - Creating a Variable Picklist

14170
12
Jump to solution
01-19-2012 06:33 AM
MichaelQuinene
Deactivated User
Hello,

I am trying to create a picklist containing a number of text variables from which a user can select from options A, B, or C.  Whichever the user chooses, it will be passed as a variable to an SQL query.  For the life of me I cannot figure out how to create such a list, if it s possible through ModelBuilder at all.  Any help would be appreciated.

Thanks,

Mike
0 Kudos
12 Replies
RichardFairhurst
MVP Honored Contributor
Based on your screen shots your script tool is still messed up.

The second parameter is supposed to have the Obtained From set to "Feature_Class_Table" (the name of the first parameter). 

The fourth parameter is supposed to be Derived not Required or Optional for the Type property.  The 4th parameter will not appear in the tool interface if it is set up correctly.  The Direction property is supposed to be Output.  Also, its Obtained From property is supposed to be "Value" (the name of the third parameter).

If it is set up correctly, after you choose your input feature class the Field parameter should create a field list that will include the field named "Problems".  Check that field.  Then the third parameter should generate a list of values from the Problem field and you should be able to choose the value you want.

The output will be the fourth parameter, which will be set to the value of the third parameter.

If this does not work start a new model, drag the tool in (once it works as a script) and then try setting it up.  If that works, delete it from your real model and add it again to refresh its settings.

This all works for me.
0 Kudos
BryanDieter
Deactivated User
I have made slight modification to the DynamicValueList script tool so that the value selection is done from a list of checkboxes as opposed to the dropdown menu.  The problem I have is that the output is still just a single value (first checkbox selected in the list).  Does anybody know how I could output all of the selected items?  [ATTACH=CONFIG]34754[/ATTACH]
0 Kudos
AbiDhakal
Frequent Contributor

I'm using a ModelBuilder to select Multiple values from a layer and it is not working. It only works when I select a single value. What am I doing wrong please.

Model:

AbiDhakal_0-1722620625263.png

Select Layer By Attribute expression window:

AbiDhakal_1-1722620625370.png

Parameter:

AbiDhakal_2-1722620625264.png

Geoprocessing:
In the window below marked in red, if I only put one value (SPB) then it will select, however if I put multiple values (SPB, EAB, etc.) as shown below it will not select. 

AbiDhakal_3-1722620625508.png

I've added a variable to the model that would allow me to put Multiple values.

AbiDhakal_4-1722620625464.png

 

Please help me.

Thank you,
Abi

0 Kudos