HOW TO

Automatically copy field values with domain labels from another field using Arcade in ArcGIS Online

Last Published: March 18, 2026

Summary

In ArcGIS Online, values from a field with an assigned domain can be automatically copied to another field in the same hosted feature layer using an Arcade expression. The expression retrieves the corresponding domain labels and writes it to the target field, ensuring the target field updates automatically when the source field is edited. This approach preserves the original field and form configuration, preventing disruptions to existing data collection workflows.

This article provides the workflow to copy field values with domain labels from the field below to another field using an Arcade expression in ArcGIS Online.

The original field's values with corresponding domain labels

Procedure

  1. In ArcGIS Online, navigate to Content > My content.
  2. Browse to the hosted feature layer to open the item page.
  3. Add a new field with a string data type. In this example, the newly created field is named TotalYears2.
Note:
The new field must be a string data type to preserve the domain label values when copying attribute values from the original field.
  1. In Map Viewer, open the web map with the hosted feature layer. Refer to ArcGIS Online: View maps for more information.
  2. On the Contents (dark) toolbar, on the Layers tab, click the feature layer.
  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 original field and the new field.
The original field and the new field in the Configure form window
  1. Click the new field form element to open the Properties pane. In this example, it is TotalYears2.
  2. In the Properties pane, under Logic, for Calculated expression, click Expressions The Expressions icon.
  1. In the Calculated expressions pop-up, click + New expression.
The + New expression button
  1. In the Arcade editor window, copy and paste the expression below. Replace <fieldName> with the name of the original field. In this example, the field name is TotalYears.
if (IsEmpty($feature.fieldName)) {
    return null;
}

return DomainName($feature, "fieldName");
The Arcade expression in the Arcade editor window
  1. Click Done.
  1. In the Properties pane, under Logic, ensure the Editable and Visible check boxes are deselected.
The unchecked Editable and Visible check boxes
  1. Click OK.
  1. On the Contents (dark) toolbar, click Save and open The Save and open icon > Save The Save icon.
Note:
Enable the Keep track of changes to the data (add, update, delete features) and Enable sync (required for offline use and collaboration) options on the Settings tab to record updates and support synchronization for offline workflows.

The Table view below displays the values in the new field, corresponding to the values in the original field.

The corresponding field values in the original and new fields

Article ID: 000040331

Software:
  • ArcGIS Online

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options