I have a When statement that works! but now I need to add an IF statement that checks another field before it applies the When statement.
I have tried several attempts but nothing is working. I am wanting to check first to see if my field PROJ_BEGIN = <null> (If null-do not add phrase) else proceed with When cause. Do I need to create an if/else statement for each variable for PROJ_BEGIN?
var status = DomainName($feature, 'CURR_PHASE')
console($feature.CURR_PHASE)
var phrase = When (status == 'Construction',"Project began in the " + ($feature.PROJ_BEGIN) + " of "+ ($feature.BEGIN_YEAR) +" and is anticipated to be completed in the "+ ($feature.PROJ_END) + " of " + ($feature.END_YEAR),
status == 'Design', "Project is anticipated to begin in the " + ($feature.PROJ_BEGIN) + " of "+ ($feature.BEGIN_YEAR) +" and expected to be completed in the "+ ($feature.PROJ_END) + " of " + ($feature.END_YEAR),
status == 'Completed', "Project began in the " + ($feature.PROJ_BEGIN) + " of "+ ($feature.BEGIN_YEAR) +" and was completed in the "+ ($feature.PROJ_END) + " of " + ($feature.END_YEAR),
status == 'Closeout', "Project began in the " + ($feature.PROJ_BEGIN) + " of "+ ($feature.BEGIN_YEAR) +" and was completed in the "+ ($feature.PROJ_END) + " of " + ($feature.END_YEAR),
status == 'Study', "No projected start date at this time",
"N/A")
return phrase;