Hello,
I have a feature (Incorporation_Date) that, in ArcGIS pro, I set to format 'Month D, YYYY' like the other date columns in my dataset. There are only two map points with this feature, so I use the following expression:
Hey @BaileyDeSimone
From what I'm seeing you're pretty close! Give this a shot here:
if (IsEmpty($feature.Incorporation_Date)) {
return null;
} else {
return "Incorporated on " + Text($feature.Incorporation_Date, "MMMM D, YYYY") + " (" + $feature.Incorporation_Citation + ")";
}
This uses the same Text feature, but assigns the format of the MMMM D YYYY, I think MMMM is the right format for this case!
Cody
@CodyPatterson has the right method but I am simply putting this one out there to show a simpler way of writing the same code.
// Option A
var D = $feature.Incorporation_Date
iif( !IsEmpty( D ) , "Incorporated on " + Text(D, "MMMM D, YYYY") + " (" + $feature.Incorporation_Citation + ")" , Null )
// Option B
var N = Null
if( !IsEmpty( $feature.Incorporation_Date ) ){ N = "Incorporated on " + Text($feature.Incorporation_Date, "MMMM D, YYYY") + " (" + $feature.Incorporation_Citation + ")" }
return N