ArcGIS JavaScript App - Edit Geoprocessing Widget Results Display

4967
17
04-03-2015 11:01 AM
JoshuaFarrow
New Contributor

As part of my JavaScript App, using Web AppBuilder, I created two geoprocessing widgets. One allows the user to input a user defined area to calculate population density (Zonal Statistics as Table tool). After the tool has ran, the geoprocessing widget returns a table with the following fields:

RowidFIDCOUNTAREASUM

Is it possible to configure the results to only display the SUM field? Something like "Total Population: [SUM]" in the results tab.

My other geoprocessing widget allows the user to input a user defined area to calculate the total number of structures within a given area (Spatial Join). The results are drawn on the map - making the user select the output polygon to retrieve the count total. Similar to my first question, is it possible to display the structure count within the geoprocessing results tab opposed to on the map within a polygon?

Thank you.

Tags (2)
0 Kudos
17 Replies
RobertMueller_Jr1
New Contributor III

Terry -

I'm not really looking for an offset, as a calculation of acres on a specific column within the Hosted Feature Layer itself. From the examples and the documentation, it would appear that you can use a Hosted Feature Layer to calculate a derivative (i.e. buffer), but the Hosted Feature Layer cannot be the output in the GP process.

0 Kudos
TerryGustafson
Occasional Contributor II

So you are wanting to calculate acres from a specific column in a hosted feature layer?

0 Kudos
RobertMueller_Jr1
New Contributor III

Yes, that is exactly what I am trying to do. I understand this is not a feature of the current ESRI Javascript API or ArcGIS WebApp builder, but surely I could string a few things together to make this possible.

0 Kudos
TerryGustafson
Occasional Contributor II

Yeah I would just create a model in the model builder with the layer you want to calculate and then use the calculate field tool. Then create the GP and you should be able to add the calculate item in WAB.

RobertMueller_Jr1
New Contributor III

Terry-

I've tried using the ESRI "Calculate Field" python script which works on a Feature Class to calculate an entire field (using: !shape.area@acres!), but if you swap the Feature Class with the Hosted Feature Layer, you run into an error because the Hosted Feature Layer is not editable in ArcMap.

I've been exploring using the "Calculate" as part of the ESRI REST to perform the same operation.

0 Kudos
TerryGustafson
Occasional Contributor II

Is your hosted feature layer public?

TerryGustafson
Occasional Contributor II

Sorry for all of the questions, is the hosted layer owned by you? Do you have that layer in SDE? Is this layer static?

0 Kudos
RobertMueller_Jr1
New Contributor III

No problem. I very much appreciate the help. I am an Admin to AGOL and yes this is a Hosted Feature Layer owned by me. I'm currently following you, if you want to send me a message I can provide 2 different dummy Hosted Feature Layers that are open to the public.

-Bob

0 Kudos