Arcade label expression to get right part of coded domain value?

1875
2
Jump to solution
09-13-2021 08:16 PM
TomMagdaleno
Occasional Contributor III

I need to do both of these:  The field is a short but the description has the text i need.  For example

Poly Vinyl Chloride - PVC  

I just need the 3 or 4 characters after the dash.  I can't figure out the syntax in label properties to do both these things at once.  

Bring up the feature material name, but only grab the last 3-4 characters.  How do I do it in Arcade?

DomainName($feature, 'material')

right($feature.material, 4,)

 

0 Kudos
1 Solution

Accepted Solutions
HåkonDreyer
Esri Contributor

Guess this should return the "PVC" you are looking for 😉

 

Trim(Split(DomainName($feature, 'material'), '-')[-1])

 

 

View solution in original post

2 Replies
HåkonDreyer
Esri Contributor

Guess this should return the "PVC" you are looking for 😉

 

Trim(Split(DomainName($feature, 'material'), '-')[-1])

 

 

TomMagdaleno
Occasional Contributor III

Thank you!!!  I was getting confused because the Right function doesn't work like other coding languages.  Trim and Split and the location of the split and the number.  Got it!  Thank you, I copied and pasted and it validated!  

0 Kudos