Arcade expression for Pop-Ups fails to display.

3603
14
03-13-2018 10:48 AM
JarettCook
New Contributor

Why won't the Attribute Expression configured for a Pop-Up save and display to a layer shared across Web Maps?

The following Arcade expression was a great work around for displaying the acres of a selected feature with the default Web Mercator Projection. 

When the expression is added to the Pop-Up of a layer of a Hosted Feature Service shared with my work group it only works for one session in Map Viewer. When the Web Map is opened latter the expression output won't display. The expression still shows in the Pop-Up configuration menu, but it doesn't display an actual output in the Pop-Up. 

The Feature Service and Web Maps in discussion are shared to a group and cached to Collector. 

Any ideas on why the saved Arcade expression quits displaying?

Thanks,

Jcoo490

14 Replies
KellyGerrow
Esri Frequent Contributor

Hi Amy and Xander,

I read into this bug a little further.  It looks like the bug is specific to using the AreaGeodetic expression with non-webmercator projection. Support is limited to geometries with a Web Mercator (wkid 3857) or a WGS 84 (wkid 4326) spatial reference.:

https://developers.arcgis.com/arcade/function-reference/geometry_functions/#areageodetic

It shouldn't have been possible to create this expression with a service in an unsupported geometry. Are you able to reproject your data into Web Mercator prior to publishing? This should get you up and running.

-Kelly

 

AmyGwin2
New Contributor III

This has been a identified as a confirmed bug. 

Based on Kelly's notes I started over from a new shapefile - in web mercator. Shared it as a hosted feature layer, enabled editor tracking. Created the expressions. 

In the webmap I drew a new polygon. However the expressions wouldn't produce any values on this new hosted feature layer. Either way ESRI documents both as supported spatial references. 

AreaGeodetic

AreaGeodetic( geometry, unit? ) -> returns: Number

Since version 1.3

Returns the geodetic area of the input geometry in the given units. This is more reliable measurement of area than Area() because it takes into account the Earth's curvature. Support is limited to geometries with a Web Mercator (wkid 3857) or a WGS 84 (wkid 4326) spatial reference.

Be aware that using $feature as input to this function will yield results only as precise as the view's scale resolution. Therefore values returned from expressions using this function may change after zooming between scales. Read more here.

NameTypeDescription
geometryPolygon / FeatureThe Polygon or Extent geometry for which to calculate the planar area.
unitString / Numberoptional Measurement unit of the return value. Use one of the string values listed in the Units reference or any of the numeric codes for area units.
Returns: Number
Example
Returns the geodetic area of the feature in square meters
AreaGeodetic($feature, 'square-meters')

I am desperate for a workaround solution for my organization to embrace ArcGIS Online for collaboration on shapes/spatial data . This is a key missing component for users. They need to be able to draw a polygon and get a very realistic size without using a secondary tool then editing to record the size. 

Would the better approach be to create a JSON feature and return the JSON geometry calculation?

0 Kudos
KellyGerrow
Esri Frequent Contributor

Are you able to share the layer that is published in Web Mercator? As this should be working with this projection I would recommend getting in contact with tech support if it isn't.

-Kelly 

AmyGwin2
New Contributor III

Kelly, I've already tried ESRI support. This has been a identified as a confirmed bug. See the note from the ESRI tech below.

Thank you for your reply. For the time being,  I have attached the bug to the case, which you now should be able to see its full description in My ESRI > My Organization > Support > Search for the bug (BUG-000117230 - Arcade expressions Round(AreaGeodetic($feature, 'square kilometers'),2) is not saved when using 'Save Layer' option in the 'Visualization' tab of the item details)

I'm looking for a workaround.

I am desperate for a workaround solution for my organization to embrace ArcGIS Online for collaboration on shapes/spatial data . This is a key missing component for our users. 

0 Kudos
XanderBakker
Esri Esteemed Contributor

The BUG mentions that the Arcade expression is not stored when saving the layer, but why don't you share the web map instead? 

0 Kudos