Hello,
I'm getting an error message when saving a layer in my web map in ArcGIS Online. It comes after I set up an attribute expression to put into my pop-up. The expression works, the code works, the values in the pop-up are correct, but apparently having a reference to $map in the code leads to this attribute expression not being saved into the layer (all other edits to the layer - adding features, modifying attributes, etc., are still saved; it's the attribute expression itself that won't save).
I based my code off of this help page: https://www.arcgis.com/apps/Cascade/index.html?appid=1c225c84ba234487b7e9a9180465fd58
For reference, what I was doing with my code was: I have two layers that are related (through the field in both layers called "Project"), a polygon layer and a point layer. The point layer has a field for quantity ("Quant"). For each polygon, I want the sum of the quantities of all the points that are within/related to that polygon, and for that sum to appear as a separate field in the polygon pop-up.
Ex: Polygon A contains 3 points, each with a Quant of 4. Therefore, Quant_total = 12.
Like I said, the code works, the pop-up looks great, but because of the $map, the attribute expression won't save. I'm not well-versed enough in coding or expressions to figure it out, I simply copied the code from the helpful link above. So, what can I do? Thanks!