Summary
In ArcGIS Experience Builder, the statistics of feature attributes can be calculated and dynamically displayed in the web app based on the map extent. This can be useful for summing or counting attribute values based on the visible features on the screen within different zoom levels.
The workflow describes how to dynamically display feature attribute statistics based on the map extent in ArcGIS Experience Builder. In this example, the total sum of bird sightings is displayed based on the visible bird sighting points on the map.
Procedure
- Open the web app in ArcGIS Experience Builder.
- Add the Map widget to the web app and select a web map as the data source. In this example, the Sydney Bird Sightings map is selected.
- Add the 'Extent changes' trigger to the Map widget to filter data records shown in the web app based on the map extent.
- On the Action tab of the Map widget, click Add a trigger.
- In the Select a trigger pane, click Extent changes > Framework > Filter data records.
- In the Action settings pane, click Select data and select the feature layer from the web map. In this example, the Sydney Bird Sightings layer is selected.
- Add the Text widget with the ‘Connect to data’ setting to display data from the features on the map.
- Add the Text widget to the web app.
- On the Content tab of the Text widget, toggle on Connect to data and click Select data.
- In the Select data pane, select the feature layer from the web map. In this example, the Bird Sightings layer is selected.
- In the Text widget on the canvas, click Dynamic content
.
- In the Dynamic content window, on the Statistics tab, configure the following parameters:
- For Operator, select the function to be operated on the field containing the attribute values. In this example, SUM is selected.
- For Field, select the field containing the attribute values to be calculated and click Insert. In this example, the Total Count field is to be summed and displayed in the widget.
Note:
Alternatively, build the same expression to sum the attribute values of the field using the Fields and Functions sub-tabs of the Expression tab in the Dynamic content pane, and click Insert.
- Save, preview and publish the web app.
The map below shows the Text widget displaying the total bird sightings based on the visible bird sighting points on the map.