I need help converting a VB Script label expression to Arcade
Function FindLabel ( [RoadName] , [RoadNumber] )if [RoadName] = "" thenFindLabel = [RoadNumber]else FindLabel = [RoadName]end ifEnd Function
The Arcade Playground is a great place to try things out. What you're doing here is similar to the Arcade function DefaultValue, in which a field is returned, but does something else if that field is null. In this case, you'd like the road number returned in that instance. This should do it:
return DefaultValue($feature['RoadName'], $feature['RoadNumber'])
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.