Hard code a Definition Query clause when using Tasks in Pro

3298
6
08-18-2017 06:04 AM
Status: In Product Plan
Labels (1)
by Anonymous User
Not applicable

Currently there is no way to set up a definition query as a task step in ArcGIS Pro with a predefined/hard coded SQL clause or even pass the SQL clause as a parameter. It would be extremely helpful when using Tasks in ArcGIS Pro if there was a way to set up a Feature Layer Definition Query as a task step and hard code the SQL clause so it is passed into the into the Definition Query automatically - minimizing the chance for error on the users part.  

The ability to set up Task has been very helpful for our workflow, especially when it comes to our "less knowledgeable" GIS users who aren't completely familiar with how certain GIS tools work.  However, relying on them to correctly enter the SQL code again and again when running a Task has opened up opportunities for them to incorrectly set up the SQL clause due to fat-finger or syntax errors.

It would be beneficial to either "hard code" the SQL clause within the task step setup in the tool OR pass the SQL statement as a parameter.  

arcgispro‌ arcgis pro 2‌ task designer‌ tasks‌ 

6 Comments
AmirBar-Maor

Hello Noelle,

Thanks for the wonderful idea.

Would the definition query be applied to:

  1. A single layer
  2. All layers
  3. Subset of layers
  4. All of the above

Thanks,

Amir

by Anonymous User

Amir: 

First I think it would be helpful just to have the definition query available for a single feature layer.  Though I do see the benefits of your other options as well.  

Thanks for considering!

MikeLachance

I agree with this idea 100%. I am currently trying to model QC workflows in Tasks but all of these workflows start with filtering datasets via definition queries and this is not something I can do in Tasks. I would be able to use Tasks much more in my work if I could set and/or clear the definition query as part of a command in a step.

I am currently working around this by creating a multi-value choice list (Python script tool) and inserting that into a GP model. The Python script takes the user input from the multi-value choice list, generates the definition query syntax, and applies it to the layers specified also within the Python code. I am using Python to do things that I think should be options in Tasks. 

Thanks!

AmirBar-Maor
Status changed to: In Product Plan
 
Katie_Clark

Very excited to see this has been added to the product plan. ArcGIS Tasks are a really great concept for documenting repetitive workflows but they're only helpful when they can be incorporated with tools and workflows that are used frequently. Definition queries being one of them - pretty ubiquitous in almost every workflow! This will be very useful!

Any update on the timeline for this functionality being added? @AmirBar-Maor 

AmirBar-Maor

@Katie_Clark 

Unfortunately, I cannot provide you with a timeline at this time. It will not be implemented in the 'near-term' (next 1-2 releases.

As a work around you can use a small python script to manipulate the definition query instead. A task step can call the script tool.

Here is an example https://community.esri.com/t5/python-questions/arcgis-pro-modifying-layer-definition-query-via/td-p/...