Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.