I am looking to run a geoprocessing service on a selected subset of feature data in a web app. I can use the entire feature layer as a parameter, but cannot seem to use only features selected either on the map or in the data table.

The end goal is to select one or more parcels in the web app and run a tool on only the selected features. I have tried using both the feature service and the map service as an input.

Is there a way to do this without resorting to using the interactive drawing input and running a spatial join?

  • Can you post the url for the gp service you're wanting to use? – Kirk Kuykendall Sep 29 '15 at 3:35
  • I don't think my boss would be too happy about pointing anyone outside to our servers just yet, so I shouldn't. The first step is simply running a buffer around the (hopefully) selected polygons, though. – Kyle Sep 29 '15 at 15:03
  • Assuming it takes a GPFeatureRecordSetLayer, you could create a FeatureSet and populate it using the array of features returned by FeatureLayer.GetSelectedFeatures. – Kirk Kuykendall Sep 29 '15 at 18:38
  • This works with Esri's sample Viewshed gp service. – Kirk Kuykendall Sep 29 '15 at 18:40
  • This certainly looks like it will work, though I am pretty much a complete novice at JavaScript. I will play around with it until I figure something out. – Kyle Sep 30 '15 at 20:01

If anyone still needs help with this, the newest version of Web App Builder now comes with a Select Widget where you can pass selected features info to other widgets like a Geoprocessing widget. More information about the Select widget here: https://doc.arcgis.com/en/web-appbuilder/create-apps/widget-select.htm

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.