Select to view content in your preferred language

Created a layer from a selection, but unique value symbology not showing

243
2
03-17-2026 08:41 AM
Warmpita
New Contributor

Hello everyone I am hoping I can get some help. So I created a new layer with the feature class to feature class tool. I basically just wanted all the pipes within an area to send out a map, but for some reason only one of the symbol classes is showing. The rest have counts, but will only show if I turn on show all other values even though that has a count of 0. One thing I think could be happening is the script for the custom field might be messing with something, but nothing looks wild to me. 

var x = DomainName($feature, 'ASSETTYPE')
var x2 = $feature.ASSETTYPE
var z = DomainName($feature, 'ownedby')
var z2 = $feature.ownedby
return When(
  (z2 == 30 && (x2 == 7 || x2 == 8 || x2 == 9 || x2 == 10)), z+" Plastic",
  (z2 == 30 && (x2 != 7 || x2 != 8 || x2 != 9 || x2 != 10)), z+" "+x,
  (z2 != 30 && (x2 == 7 || x2 == 8 || x2 == 9 || x2 == 10)), "Plastic",
  (z2 != 30 && (x2 != 7 || x2 != 8 || x2 != 9 || x2 != 10)), x,
  "Unknown"
);

 Any ideas, this is making me feel dumb!

0 Kudos
2 Replies
Warmpita
New Contributor

Sorry I can't post any pictures as hosting sites are blocked from my work computer. Literally any ideas would be welcome as I am completely stumped here

0 Kudos
KenBuja
MVP Esteemed Contributor

What are the symbol classes that are being returned? Do you have values in ASSETTYPE and ownedby that will return all possible classes? Arcade will not create a symbol for a value that isn't in the attributes. For example, if you don't have any ASSETTYPE == 30, the legend will not have the classes from lines 6 or 7. When I create a legend from an Arcade script, I'll put in dummy values in the attributes to get all the possible combinations, then remove them after running the script.

This is another way to write your script

var x2 = $feature.ASSETTYPE;
var z2 = $feature.ownedby;

var x = iif(x2 >= 7 && x2 <= 10, "Plastic", DomainName($feature, 'ASSETTYPE'));
return iif(z2 == 30, DomainName($feature, 'ownedby') + " " + x, x);

 

0 Kudos