Arcade expression for related features don't show in popup

112
3
Jump to solution
08-18-2022 08:18 AM
Ulises
by
Occasional Contributor II

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.

Ulises_0-1660835627583.png

 

But the popup just don't show the results expected.

Ulises_1-1660835721168.png

Ulises_2-1660835737016.png

Any help is appreciated.

 

Thanks

Ulises Feliciano Troche
0 Kudos
1 Solution

Accepted Solutions
Ulises
by
Occasional Contributor II

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.

Ulises Feliciano Troche

View solution in original post

0 Kudos
3 Replies
JohannesLindner
MVP Regular Contributor

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.


Have a great day!
Johannes
0 Kudos
Ulises
by
Occasional Contributor II
Yes to both. Just added from the attributes list once created.
Ulises Feliciano Troche
0 Kudos
Ulises
by
Occasional Contributor II

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.

Ulises Feliciano Troche
0 Kudos