Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a tool where individuals can select a variety of records using a SQL expression that is then passed to a calculation. I can add a parameter under the tool, and select SQL expression, but when I click on the SQL expression box its not "populated" by potential fields, and therefore unable to get unique values. I thought this might be because the tool needed to know which .shp file it was calling, so I added a higher level parameter to specify the .shp file, but still no luck, the SQL parameter remains entry. Any suggestions would be much appreciated,

share|improve this question
up vote 5 down vote accepted

I was able to get the SQL Expression parameter's dialog to populate by setting its Obtained From property to the input Feature Layer parameter I created:

Script Tool Parameters screenshot Query Builder screenshot

Note that Feature Layer parameters also accept feature classes, e.g. a path to a shapefile or feature class, in addition to the name of a feature layer in the current map document or in the current geoprocessing session. The SQL Expression dialog was populated correctly in both cases for me.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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