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!
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
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);