Trying to label this feature class on it's Name field. If the Name field is Null then I want to place custom text.
This is what I have:
var name = $feature.name
IIf(IsEmpty(name) == False, name, 'landing ground')
But it only seems to label the True part of the statement and not the False, so I see the name, but not the text "landing ground" (image 2).
This seems really basic stuff, so can't work out why it's not working like I think it should.
Solved! Go to Solution.
IsEmpty evaluates to a boolean, and "!" negates a condition, so you can re-write that as
Iif(!IsEmpty(name), name, 'landing ground')
But what you're essentially doing is replicating the function DefaultValue. Try this:
DefaultValue(name, 'landing ground')
IsEmpty evaluates to a boolean, and "!" negates a condition, so you can re-write that as
Iif(!IsEmpty(name), name, 'landing ground')
But what you're essentially doing is replicating the function DefaultValue. Try this:
DefaultValue(name, 'landing ground')
Thanks @jcarlson but that's yielding the exact same result. I'm still missing labels for records with the Null value
OK, clearly I wasn't awake! I had a SQL limiting which records were being returned. Rookie error.
Thanks for your help!
Ah! That was my next question! Always nice when it's a simple solution.