HOW TO

Trigger a custom message for points created outside polygons in ArcGIS Enterprise Map Viewer

First Published: September 8, 2026
Last Published: September 8, 2026

Summary

In the ArcGIS Enterprise portal, configuring spatial validation in a map restricts the creation or update of point features outside polygon boundaries. This ensures data is collected only within the designated project areas or boundaries.

This article outlines the workflow for triggering a custom message when points are created outside the polygons or boundaries in ArcGIS Enterprise Map Viewer.

Procedure

Note:
This workflow is applicable only when using ArcGIS Pro with an ArcGIS Enterprise account and publishing datasets to an ArcGIS Enterprise portal using the Reference registered data option. Refer to ArcGIS Pro: Share datasets with attribute rules for more information.
  1. Configure the ArcGIS Enterprise portal as the active portal in ArcGIS Pro.
    1. Open the ArcGIS Pro project and click Project > Portals.
    2. Log in to the ArcGIS Enterprise portal and set it as the active portal.
    3. Click the back The back icon icon.
  1. Create a new enterprise geodatabase connection.
    1. On the Insert tab, in the Project group, click Connections > Database > New Database Connection.
    2. Create a file that connects to an enterprise geodatabase. Refer to ArcGIS Pro: Create Database Connection (Data Management Tools) for more information.
  1. Add global IDs and apply an attribute rule to display the custom error message in ArcGIS Pro.
    1. On the Analysis tab, in the Geoprocessing group, click Tools to open the Geoprocessing pane.
    2. Search for and run the Add Global IDs tool to add global IDs to the point layer. In this example, the Site layer is the input dataset used to assign the global IDs.
    3. In the Contents pane, right-click the point layer and click Data Design > Attribute Rules. In this example, the selected layer is Site.
    4. In the Attribute Rules view, create a constraint rule. Refer to Steps 4 through 6 in How To: Prevent NULL and empty string values in an attribute table in ArcGIS Pro for instructions. For Step 6, add the following Arcade expression in the expression box:
var polygons = FeatureSetByName($datastore, "<Polygon layer Name>", ["OBJECTID"], true);
var matches = Intersects(polygons, Geometry($feature));
return Count(matches) > 0;
  1. Click Verify > OK.
  2. For Triggers, check the Insert check box.
  3. For Error, specify a value in the Error Number box and enter descriptive text for Error Message. In this example, the error number is specified as 1001, and the error message is "Point must be located inside a valid polygon."
The Rule pane with the specified Arcade expression, error number, and error message for the constraint attribute rule
  1. On the Attribute Rules tab, in the Manage Edits group, click Save to save the attribute rules.

The error message below indicates that point features cannot be created outside the polygon boundary.

The error message
  1. In the Contents pane, right-click the point layer and click Attribute Table. Add a new field using the Add Field tool. This field is used to display the warning message when creating features in Map Viewer. In this example, the CollectionType field is added.
  2. Share the layers with attribute rules to the ArcGIS Enterprise portal using the Reference registered data option. In this example, the feature layer name is specified as Test_Attribute_Rule.
  3. Open the hosted feature layer in Map Viewer.
    1. Sign in to the ArcGIS Enterprise portal and navigate to Content > My content.
    2. On the My content tab, select the hosted feature layer to open the item page. In this example, the Test_Attribute_Rule feature layer is selected.
    3. On the Overview tab, click Open in Map Viewer.
  1. Configure a form to include a warning message in Map Viewer.
    1. In the Layers pane, search for and select the point layer, and configure an input form for it. Refer to Steps 4 through 6 in ArcGIS Enterprise on Windows and Linux: Configure a form for instructions. In this example, the Site layer is selected, and the Convert the existing pop-up option is used in Step 5.
    2. In the Configure form window, click the field to be used for the warning message display. In this example, the CollectionType field is selected.
    3. In the Properties pane, navigate to the Logic section, and click the Expression icon Icon for Expression setting next to Calculated expression.
    4. In the Expression pop-up, click + New expression.
    5. Specify the following Arcade expression in the Expression window:
var polygons = FeatureSetByName($map, "<Polygon layer name>", ["OBJECTID"], true);
var pointGeometry = Geometry($feature);

if (IsEmpty(pointGeometry)) {
  return null;
}

var matches = Intersects(polygons, pointGeometry);
if (Count(matches) == 0) {
  return "<Warning message>";
}

return null;
The full working expression in this example
  1. Click Done > OK.

The custom warning message is displayed in the CollectionType field when a point is created outside the polygon boundary, as shown below.

The warning message displayed in Map Viewer

Article ID: 000043037

Software:
  • ArcGIS Pro
  • Portal for ArcGIS
  • ArcGIS Enterprise

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options