Changes in Arcade Expressions in ArcGIS Solutions

281
0
03-06-2023 10:38 AM
AndyShoemaker
Esri Contributor
1 0 281

Some of the recent updates to ArcGIS Online’s Arcade capabilities have a changed how fields are accessed by scripts provided in ArcGIS Solutions. As a result of these updates some of our popups are not providing all the information they used to.

One specific instance we are aware of is the Amenities Arcade Element. It may appear under different names for each solution. This goal of this expression is to load fields and check if they contain the domain value of “Yes. If the field is set to “Yes” then the expression returns the alias of the field with a check mark next to it.

When this expression is run manually (in the Edit Expression menu) it appears to produce the desired result, however when viewed in the popup, nothing shows up because we are implicitly loading the fields.

 

AndyShoemaker_0-1678122448270.png

 

We can fix this quite easily by explicitly telling the Arcade function to load all the fields necessary. Simply add the expression immediately below the “DO NOT CHANGE ANYTHING BELOW THIS LINE” warning. When the popup is clicked, the function will pull in all the fields and the result of the expression in the popup will be as expected.

 

 

 

Expects($feature, "*")

 

 

 

AndyShoemaker_1-1678122634281.png

 

 

Tags (2)