I have the following code that applies a Yes or a No to the UNIT field, determined by the UNIT_NUM field. IF the UNIT_NUM field has a value, then UNIT should be "Yes". If it is blank, then UNIT should be "No":
var unitNumber = $feature.UNIT_NUM
var hasValue
IIF(IsEmpty(unitNumber), hasValue = "No", hasValue = "Yes")
The arcade code seems to be fine, however, when I go to add a new address point, I get an error in my Create Features pane that says "Failed to create ADDR_point. Value doesn't fall within Domain: Yes_No
My Yes_No domain is set up like this and is also applied to the UNIT field of my ADDR_point feature class:
- Domain Name = Yes_No
- Field Type = Text
- Domain Type = Coded Value Domain
- Code "Yes" - Description: "Yes"
- Code "No" - Description: "No"
- Split & Merge Policy = Default
When I go to add a point, I get the error, but I also notice that when I click on the right arrow seen below...
... it opens up the attributes for the new point I'm trying to create and the UNIT field is highlighted with a "N" in the cell. Not a "No", which is what I expected. If I manually select the cell, I can choose "Yes" or "No" and the point will be produced, but I want this to be automatic. Any ideas on where I've gone wrong in any of my syntax?