Hi Xander, Thank you for this great example and all your answers, it's an Arcade goldmine. I'm trying to replicate the popup functionality in one of my own webmap on a portal, but I keep running into the same error: "Execution Error:Runtime Error: Variable must be declared before it is used.." but I can't see any undeclared variables in the code. -------------------- var fs = FeatureSetByName($map, "NaO", ["skovnavn"]); var fsIntersects = Intersects(fs, $feature); var cnt = Count(fsIntersects); //var fsDistincts = Distinct(fsIntersects,["skovnavn"]); //var cnt = Count(fsDistincts); var resultat = ""; if (cnt > 0){ for (var fsIntersect in fsIntersects){ var txt_skovnavn = Text(fsIntersect.skovnavn); resultat += txt_skovnavn + ", " } } else { resultat = "Hvorfor er der ingen skove på denne enhed?"; } resultat = Text(Left(resultat,Count(resultat)-2)) + "." return resultat; ------------------------------- The map is shared on: https://gis.nst.dk/portal/home/webmap/viewer.html?webmap=b8be8d61e775431c8f5a92887b49860e I have tried almost the same code in ArcGIS Pro ($datastore instead of $map in the first line) to calculate a field and in this environment I don't get any errors. Note: I tried the code on ArcGIS Online and it ran without any problems, so I assume that it must be the portal security kicking in somehow.
... View more