HOW TO

Automatically calculate area when creating polygon features in Portal for ArcGIS Map Viewer

Last Published: June 17, 2025

Summary

In ArcGIS Online, it is possible to automatically calculate area when a polygon feature is created in Map Viewer. This functionality can be automated by configuring the appropriate field in the form within Map Viewer. This helps maintain accurate area information during updates and minimizes the risk of errors.

The workflow in this article is applicable for ArcGIS Online and Portal for ArcGIS Map Viewer. This article outlines the workflow for automatically calculating the area when creating polygon features in ArcGIS Online.

Procedure

  1. Log in to ArcGIS Online and click Content > My content.
  2. Browse to and click the web map. On the item page, click Open in Map Viewer.
  3. On the Settings (light) toolbar, click Configure editing The Configure editing icon > Forms The Forms icon.
  4. In the Configure form window, in the Form builder pane, under Fields, double-click the field to calculate.
  5. Click the selected field form element to open its Properties pane.
  6. In the Properties pane, expand Logic, and under Calculated expression, click the Expression icon The Expression icon.
  7. In the Calculated expressions pop-up, click +New expression.
  8. In the New expression window, specify the following Arcade expression and replace <unit> with the desired unit of measurement. Refer to ArcGIS Arcade: FeatureSet functions for more examples of the unit of measurement.
var area_unit = 0

if ($editcontext.editType == "INSERT") {
    var geom = Geometry($feature)
    area_unit = AreaGeodetic(geom, '<unit>')
}

return area_unit

The code below is the full Arcade expression, with acres used as the unit of measurement in this example.

var area_unit = 0

if ($editcontext.editType == "INSERT") {
    var geom = Geometry($feature)
    area_unit = AreaGeodetic(geom, 'acres')
}

return area_unit
  1. Click Done.
  2. In the Properties pane, click OK.
  3. On the Contents (dark) toolbar, click Save and open > Save The Save icon.
Note: 
The area of the polygon is calculated in the 'Create features' pane after the polygon feature is created.

The image below shows the area of the polygon features automatically calculated when a new polygon is added to the map.

The automatically calculated area of the polygon features when a new polygon is created
Note: 
This functionality can also be implemented in ArcGIS Field Maps Designer using the same expression. Refer to ArcGIS Field Maps: Add calculated expressions for instructions.

Article ID: 000036152

Software:
  • ArcGIS Online
  • ArcGIS Enterprise
  • ArcGIS Field Maps Designer

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options