Select to view content in your preferred language

Arcade label Expression

382
1
Jump to solution
07-18-2023 07:38 AM
AndyIngall
New Contributor III

I am new to arcade and trying to create a labeling expression from two fields.  I have records with numerous fields but importantly RoadName and Road Number.  If RoadName contains a value the label with that, if RoadNumber contains a value then label with that, if both field have a value then use RoadName & " " & RoadNumber...

Is this possible and if so how.....

 

1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

Here's one way to do that.

var RoadName = $feature.RoadName;
var RoadNumber = $feature.RoadNumber ;
var output = '';

if (!IsEmpty(RoadName)) output = RoadName + ' ';
if (!IsEmpty(RoadNumber)) output += RoadNumber;
return Trim(output);

View solution in original post

1 Reply
KenBuja
MVP Esteemed Contributor

Here's one way to do that.

var RoadName = $feature.RoadName;
var RoadNumber = $feature.RoadNumber ;
var output = '';

if (!IsEmpty(RoadName)) output = RoadName + ' ';
if (!IsEmpty(RoadNumber)) output += RoadNumber;
return Trim(output);