Select to view content in your preferred language

Labeling from 3 attribute fields

210
3
Jump to solution
02-27-2025 11:34 AM
Labels (1)
JohnEsch2
Occasional Contributor

I have 3 attribute fields that I would like to label from: ex> Field,1 Field2, and Field3. Field1 is the main attribute field with most the data so that is the main attribute to label. In some cases Field1 is Null and if that is the case then label from Field2. In some cases both Field1 and Field2 are Null, then I would like to label from field 3. I do not want to label from all three at the same time. I am looking for a labeling expression to allow me to do this. Thanks

Tags (1)
2 Solutions

Accepted Solutions
KenBuja
MVP Esteemed Contributor

Here's a way to do that using Arcade, returning the first field that isn't null.

When(!IsEmpty($feature.field), $feature.field,
     !IsEmpty($feature.field1), $feature.field1,
     !IsEmpty($feature.field2), $feature.field2,
     "No attributes");

 

View solution in original post

JohnEsch2
Occasional Contributor

thanks Ken, it worked great.

View solution in original post

0 Kudos
3 Replies
Ed_
by MVP Regular Contributor
MVP Regular Contributor

May be use if else with IsEmpty() function or == null to see whether the variable is null via Arcade?

Question | Analyze | Visualize
0 Kudos
KenBuja
MVP Esteemed Contributor

Here's a way to do that using Arcade, returning the first field that isn't null.

When(!IsEmpty($feature.field), $feature.field,
     !IsEmpty($feature.field1), $feature.field1,
     !IsEmpty($feature.field2), $feature.field2,
     "No attributes");

 

JohnEsch2
Occasional Contributor

thanks Ken, it worked great.

0 Kudos