How do I return a value from a domain in a field using arcade?
for example:
var new = Split($feature.siteID,"(")
return new[1]
The above is what I would do to return text from a non-domain field. How do I get it to read the domain value?
Solved! Go to Solution.
I got it!
var new = Trim(Split(DomainName($feature, 'siteid'), '(')[1])
return new
Are you trying to return characters that are in the same location of the 'siteID' column?
You may want to try using the functions - right, left, or mid - if the pattern is the same.
Edit - it might look like this --> left($feature.siteID, 4) (4 = guess of number of site ID characters you're trying to return)
So the field in question uses a domain. I am trying to return part of the value. Not the code.
The split function above returns part of the code. Not what I need.
I am using split because I need everything right of the "(" in the value.
I just can't figure out the syntax to extract part of the value of the domain in said field. I am trying to populate another field using arcade in the field calculator.
I got it!
var new = Trim(Split(DomainName($feature, 'siteid'), '(')[1])
return new