Using Field calc I would like to return part of the domain value, not the code.

522
4
Jump to solution
07-08-2022 08:30 AM
JeffTimm
Occasional Contributor

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?

0 Kudos
1 Solution

Accepted Solutions
JeffTimm
Occasional Contributor

I got it!

var new = Trim(Split(DomainName($feature, 'siteid'), '(')[1])
return new

View solution in original post

0 Kudos
4 Replies
CaseyDunnGossin
New Contributor

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)

0 Kudos
JeffTimm
Occasional Contributor

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.

0 Kudos
JeffTimm
Occasional Contributor

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.

 

0 Kudos
JeffTimm
Occasional Contributor

I got it!

var new = Trim(Split(DomainName($feature, 'siteid'), '(')[1])
return new

0 Kudos