I'm trying to calculate a field in the same record of an attribute table based on the code associated with a coded domain.
I have a field ("activity") that uses a domain that contains a code (ex: 314) and description (ex: invasive removal). I select the value from the domain drop down that contains both the code and the description (ex: 314-invasive removal) combined when creating a record to match symbology to a style later. I'd like to populate a field ("ActivityCode") in the same record with only the code from the domain so it just prints "314". Then, similarly, another field that just prints the description.
The codes vary in length so using right, left, mid functions won't work unless I can use a string in calculate field to count left from the dash between the code and description?
Or is there a way to calculate the code from what is associated with what I selected?