AnsweredAssumed Answered

Web AppBuilder - Attribute Expressions

Question asked by palk1ste on Feb 13, 2020
Latest reply on Feb 14, 2020 by palk1ste

Hi all. I'm having some issues with a web map and web app that I am building through my organization's ArcGIS Online portal.

 

I have a web map with multiple layers and I have configured some of the popups for different layers with attribute expressions. The code I'm using looks like this:

// Convert Lines/Polygons to Points
var PointGeometry = Centroid(Geometry($feature));
var pointX = PointGeometry.x;
var pointY = PointGeometry.y;

return (text(pointX) + ":" + text(pointY);

 

The popup works fine but when I try to view the attribute table for this layer in the web app no records ever load. In Chrome's console I am getting the error "Error: Runtime Error: Cannot call member method on null."

 

Changing the code to:

// Convert Lines/Polygons to Points
var PointGeometry = Centroid(Geometry($feature));

return (text(PointGeometry));

actually resolves the issue. Obviously this is not ideal since it is much harder for users to read. It seems like accessing the attributes of the geometry is causing the issue.

 

Any ideas why this is happening?

Outcomes