Map Fields

The Map Fields tool Map Fields tool transforms data from an input schema to an output schema. You can perform field calculations, create fields, and tag key fields with the Map Fields tool.

Examples

  • A city GIS analyst wants to process any new features added to a feature layer and change field names, drop certain fields, and create other fields using Arcade expressions.
  • A data analyst wants to change the schema of millions of records of data stored in delimited text files in the cloud. This tool can change field names, drop some fields, and create other fields using Arcade expressions.
  • An IoT specialist wants to use an Arcade expression to parse geometry values from string fields and set these values as feature geometry.

Usage notes

  • Perform field calculations while mapping fields using Arcade expressions. Arcade is a lightweight and secure expression language written for use in ArcGIS. Like other expression languages, it can perform mathematical calculations and evaluate logical statements. For a full overview of supported expressions and functions, see the ArcGIS Arcade expression language.
  • Optionally, geometry can be configured and adjusted using the optional configure geometry parameters. Additional parameter details regarding geometry expression and spatial reference specification are available below.
  • ArcGIS clients do not currently support 64-bit integer field types. For this reason, if a field is designated as Int64, that field will be converted to Float64 and listed as type Double in any associated map or feature services.
  • As an alternative to the Map Fields tool, you can also set field name modification and key field tagging when first configuring a source or feed. For details, see Configure input data.
  • In a real-time analytic, be careful not to remove the TRACK_ID tag from a feed, as that will invalidate it. As a best practice, when changing the field tagged with TRACK_ID, the new TRACK_ID field should be one whose values are the result of a function that incorporates the original Track ID field values. For example, this may be a new field containing a concatenation of the original TRACK_ID field values with those of another field.
  • Geometry calculation with this tool is currently restricted to the WKID spatial reference. The WKT spatial reference is not supported by the Arcade geometry function.

Parameters

Geometry Configuration

ParameterDescriptionData type

Input Layer

The features for which the fields will be mapped to a new schema.

Features

Geometry Expression

The expression containing a point, multipoint, polyline, or polygon Arcade function.

The function should contain a valid Esri geometry object.

Note:

If the spatial reference of the input schema is not specified (tabular data), or any spatial reference other than GCS WGS 1984 (WKID: 4326) is used, the spatial reference must be specified in the Arcade expression to evaluate successfully. Otherwise, the following error will display Execution Error: Cannot create Geometry in this Spatial Reference. Engine is using a different spatial reference.

Example Arcade expressions to build geometry are as follows:

  • Generate point geometry using existing latitude and longitude fields in the feature schema.
    • Point({"x" : $feature.longitude, "y" : $feature.latitude, "spatialReference" : {"wkid" : 4326}})
  • Generate polyline geometry using existing latitude and longitude fields in the feature schema.
    • Polyline({"paths":[[[$feature.longitude,$feature.latitude],[$feature.longitude+5000,$feature.latitude+5000]]],"spatialReference":{"wkid":102100}})

String

Spatial Reference

The spatial reference of the geometry produced by the geometry expression. This can be provided as a WKID or as a WKT string.

The spatial reference specified here must match the spatial reference of the Esri geometry object if specified in the expression.

JSON WKID or WKT object

Attribute Field Mapping

ParameterDescriptionData type

Input Layer

The features for which the fields will be mapped to a new schema.

Features

Input Field

The schema of the data received by the tool. For each entry in the list of input fields, map from an existing field in the input layer or build an Arcade expression to calculate a new value to be written to the designated Output Field parameter.

String

Output Field

The schema of the data after being transformed by the tool.

String

Key Field

Identify the key fields to tag fields with their function, if applicable.

String

Nullable

Specifies whether the mapped field can contain null values.

Boolean

Output layer

The output layer will have the schema as defined by the list of output fields. If geometry was configured, the geometry will change per the specified geometry expression and spatial reference.