I am building a python tool in ArcGIS. When I build the parameters I will have 3:
- Choose a shapefile (parameter data type = shapefile)
- Choose an SQL query (parameter data type = SQL Expression)
- Choose an output folder for a .xls report (parameter data type = Folder)
The first 2 parameters are an either/or scenario. The user will either choose a shapefile for the input or they will build an SQL Query on a very specific feature class (I do not want them to choose both parameters).
Whichever option the user choose, the parameter will be eventually used as the 'clip feature' in the arcpy.Clip_analysis function.
- Is there a way to limit the user from choosing both (i.e. if they choose the shapefile option, have the SQL query grey out automatically and vice versa). Maybe using the validator class?
- I want to 'Obtain From' a very specific feature class to be used in the SQL parameter. The parameter property for 'Obtain From' only allows me to obtain from another parameter. Is there any way to 'Obtain From' it's own source? It won't allow me to enter a default datasource and choose that for the 'Obtain From'. Maybe I can also do this through the validator class as well?