I'm testing how to show an arcade expression in a popup that filter and relates data. Following an example in a blog I want to show data from a point hosted layer in a polygon hosted layer popup. My code is...
var portal = Portal("https://<<myportal>>/portal")
var permisos = FeatureSetByPortalItem(portal,"59e9fa29fcb149148dd95b6ea7fb3364", 0,['Caso','catastro'],true);
var Parcela = $feature["NUM_CATASTRO"]
var filterStatement = 'catastro = @Parcela'
var relatedData = Filter(permisos,filterStatement)
var relatedDataSorted = OrderBy(relatedData,'caso asc')
var popupString = ''
popupString +=
"Parcela: " +
DefaultValue($feature["NUM_CATASTRO"], 'no data') + TextFormatting.NewLine +
"OLDPID: " + DefaultValue($feature["OLDPID"], 'no data') + TextFormatting.NewLine +
TextFormatting.NewLine
for (var f in relatedDataSorted){
popupString +=
"PermisoID: " +
DefaultValue(f.Caso, 'no data') + TextFormatting.NewLine
}
DefaultValue(popupString, 'No measurements to show')
return popupString
I can successfully test the expression in the dialog window.
But the popup just don't show the results expected.
Any help is appreciated.
Thanks
Solved! Go to Solution.
Update...
The popup showing the Arcade expression works fine when using the new Map Viewer. I was testing and using the Classic Map Viewer. Had some issues with the new viewer hence I was testing in the classic viewer. Guess it will depends on what your working with to see in which version of the map viewer will work. Always test in both versions.
Is this expression actually {expression/expr0}?
Have you actually applied the popup config? The popup only changes after you click OK in the configuration window.
Update...
The popup showing the Arcade expression works fine when using the new Map Viewer. I was testing and using the Classic Map Viewer. Had some issues with the new viewer hence I was testing in the classic viewer. Guess it will depends on what your working with to see in which version of the map viewer will work. Always test in both versions.