I would like to reproduce the Select By Attributes tool below in ArcMap as a geoprocessing tool to be consumed as a service in a Portal for ArcGIS Web App.

I am not a developer.

How do I get the sql query builder included in the Select Layer By Attribute geoprocessing service?

  • Welcome to GIS SE! As a new user be sure to take the Tour. As it stands I think your question is too broad but I think it could easily be brought on-topic by dropping the request for code, removing your image, and replacing that image with text and embedded pictures. – PolyGeo Jul 9 '15 at 10:26

Your question requires a bit more context in regards to what your end goal is.

If your goal is to provide some sort of popup where the user can select features based on a SQL query and see them highlighted on the map, you do not need geoprocessing or SLBA. You just want to use some sort of query task or widget in a web application. Check out the query widget in the web app builder (WAB)

If your goal is to do some sort of query and then do something with those selected features, like buffer or hot spots, etc, then SLBA inside a tool (python script or model), published as a geoprocessing service makes sense. However, geoprocessing services are very closely tied to the data required to run them. So you'd author the GP task using the same data that the map service the web app uses. Technically the map service and the GP task aren't connected in any physical way. Its just the web app always you to display and consume both in 1 spot. Another way to say this: the 2 services may use the same data, but doing a select in the gp service isn't doing a select in the map service. The gp service can send back features and the app will draw the selection. But why do this? (if thats the goal) The query task as mentioned above would make more sense in terms of ease of use and performance.

| improve this answer | |
  • Thank you for your reply. I am aware of the Query Widget, I however do not feel it is adequate for the use I want to put it. My goal, as you have mentioned, is that my users query the dataset in order to display selection and nothing more. The data in question is a bus route network with over 400 routes and a massive amount information, such as fares, services, etc. The goal is for my organizations Bus Engineers to be able to query the database for any conceivable information they might require. In my opinion the Query Widget isn't robust enough, thats why I will prefer a GP like SLBA. – Lara Jul 9 '15 at 14:37
  • I have already created a GP Service of the Select Layer By Attribute, everything but the embedded Query Builder, worked. I'm new here and don't know how to attach a file, I would have liked to send you an attachment so that you can see what I have done and what the problem is. If you can, you can read my post on GeoNet, where I was asking for help on this same issue. geonet.esri.com/thread/160845 – Lara Jul 9 '15 at 14:46
  • Once you get SLBA published as a GP Service, you need to make the nice interface as a web app developer to use it. The UI you see where you get to pick and design a SQL query like in ArcMap doesn't just happen out of the box. The SQL Expression SLBA requires gets turned into a simple string when published. Pretty sure the WAB has no logic to automatically pretty up that string into a SQL clause, thus leaving it on you. – KHibma Jul 9 '15 at 15:04
  • So again, I go back to the Query Widget as it provides a "pretty interface" for constructing a SQL Query. – KHibma Jul 9 '15 at 15:06
  • Since I am not a developer, I have no choice but to go back to Query Widget. Thanks for your help. – Lara Jul 9 '15 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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