PROBLEM
When accessing the property of a feature class that contains a period in the field name (for example, SHAPE.AREA), the script reads the property as a separate part and labels the property as undefined.
The period in JavaScript dictates an access of an attribute or the calling of a method or function of an object. For example, map.setExtent calls for the object map, and uses the function setExtent.
If a line of code refers to a field name in a feature contains periods, for example:
result.features[0].attribute.SHAPE.AREAThis results in the JavaScript failing to define the property after SHAPE, and returns the result as undefined for the property.
results.features[0].attributes["SHAPE.AREA"]
Note: In the original code snippet, calling a field alias is done using the exact alias of the field. In the counter code, the code uses an array that searches any attribute field with the name SHAPE.AREA. This method can be modified to vary the range of search. To increase the accuracy of the search parameter and to get only the desired fields, use the full alias name.
Get help from ArcGIS experts
Download the Esri Support App