Hello, being a beginner on arcpy and in the design of my first script tool in arcgis pro
I want to know if it is possible to access the "SQL Expression" parameters with python and add lists of personalized filters in order to create personal SQL queries.
Thank you very much for your help.
No. The SQL Expression parameter requires a dependency.
You don't have to set that dependency in the parameter editor. You can also use the parameter.parameterDependencies property in the validation:
class ToolValidator:
def __init__(self):
self.params = arcpy.GetParameterInfo()
def updateParameters(self):
self.params[1].parameterDependencies = ["layer"]
But for the tool to fill out the lists of field names and values, the parameter needs a dependency.
If you don't want to do it that way, you could use a string parameter. Users can then simply input their query (or you can prepare a dropdown).
Thanks, I was able to access all my settings and do my search tasks while running the script. However, for each value change in my searches, I would like to delete my previous query definition, can I do that?