Select to view content in your preferred language

Symbology driven by Arcade code block fails in Field Maps

409
7
2 weeks ago
AmyRoust
Frequent Contributor

I've seen several posts that are similar to my issue, but no perfect matches. I have a line feature layer that is symbolized using an Arcade code block. The symbology works in Pro and in Map Viewer, but when you open that same web map in Field Maps, all of the lines default to the "other" symbology instead of matching what's in the legend. Are there limitations on Arcade-driven symbology in Field Maps? If it matters, I'm on Field Maps version 25.1.0, build 1141.

0 Kudos
7 Replies
AustinAverill
Frequent Contributor

Can you share what the code looks like? I believe there are a few limitations of the Arcade Profile associated with field maps as compared to Map Viewer.

I know there is also some behavior with Arcade symbology that can be driven by the starting extent of your map. For instance, in some cases if your map loads to an extent without any of the applicable features visible in the map extent, the symbology is defined for the layer without returning anything from the logic you generated in Arcade and everything becomes symbolized as other because it was never defined on initialization of the map.

0 Kudos
AmyRoust
Frequent Contributor

Sure! Here's a screenshot:

Linework Symbology Arcade Statement.png

0 Kudos
AustinAverill
Frequent Contributor

I don't see anything within this that sticks out as something that wouldn't function in Field Maps. Have you looked at the extent behavior i mentioned in my previous?

0 Kudos
AmyRoust
Frequent Contributor

No luck on the extent. Even if I make sure to save the web map while it's zoomed in to a point where the lines are immediately visible, they draw with the "other" symbology. Or are you saying that the mere presence of a scale dependency is enough to derail rendering in Field Maps?

0 Kudos
AustinAverill
Frequent Contributor

The way I have experienced it - 

If there isn't at least one feature to satisfy each logical expression visible within the extent, the expression will only evaluate to other. Typically what I have to do for this is make sure that I am at a point where the entire layer is visible in Map Viewer, then open up the arcade expression, add a comment line so I can resave the expression, then click save. With every feature visible it should calculate all the various categories.

0 Kudos
AmyRoust
Frequent Contributor

Interesting. If that's the case, my symbology will never work because Field Maps is set to zoom in to your location and you don't see every possible feature type within that narrow window. I wish I had a way to test and confirm your theory without creating an entirely new dataset!

When you have had this happen, does the legend render with the correct symbology?

0 Kudos
AustinAverill
Frequent Contributor

Typically, no. The way this appears to work is that the arcade expression evaluates against the currently queried data in the map frame and then stores the resultant symbology renderer for the session. So let's say you have a script that looks something like the following: 

if($feature.attribute == 1){
    return 1
}else if($feature.attribute == 2){
    return 2
}

If this expression is stored as the symbology definition for a layer and the initial map frame only contains features with the attribute 1, the symbology will only define "1" and "Other" with all features with the 2 attribute being grouped into "Other". Similarly, if no features are visible in the map frame, the expression will not calculate any "1" or "2" attributes and therefor everything else will be stored as "Other" when they appear in the frame.

 

Typically in the past, I have had no issues with arcade expressions working appropriately in Field Maps despite this inherent quirk. But there is entirely a possibility that recent updates have caused some sort of issue. Hopefully someone else will be able to weigh in with another idea or suggestion to explore.

0 Kudos