We are using the Add Attribute Rule tool to execute an arcade script (Script 1). This is for an app we are developing. I want the script to return null in the “PlannedClosureStart” date field (line 3) when “No” is input in the “PlannedClosure” text field (line 0). However, when I try to add this the tool returns the error “ERROR 000358: Invalid expression Failed to execute (AddAttributeRule)”.
Is it possible to add null values to date fields in an arcade script?
Script 1
var PlannedStart = $feature.PlannedClosure;
if (PlannedStart=="Yes") {
return $feature.PlannedClosureStart
}
else return null