Using ArcGIS Enterprise 10.9.1 - Field Maps version 21.4.0. I am wondering someone can assist with an issue I came across in an arcade expression that is intended to update a date field when a single field is attributed?
When I apply the following attribute rule to my "Radio_Install_Date" field, I would like for today's date to populate in the "Radio_Install_Date" field when the "Radio_ID" field is attributed. This works as planned. The problem comes when I then update any other field within the feature class as that update causes the date in the "Radio_Install_Date" field to update once more since a value is present in the "Radio_ID" field. The updating stops occurring only when the "Radio_ID" field is empty.
So, my question is can there be anything added to my expression that would ONLY update the "Radio_Install_Date" field when the "Radio_ID" field is attributed...nothing else?
//Immediate attribute rule on the feature class
//Triggers: Insert, Update
//Field: Radio_Install_Date
var emptyRadioID = $feature.Radio_ID
if (IsEmpty(emptyRadioID)){
return emptyRadioID}
else{
return Date()
}
Solved! Go to Solution.
Try incorporating a compare of the original value to the current value...Can make sure that if the RadioID isn't changed then the Install Date will not change. something like:
if (IsEmpty($feature.RadioID) || $feature.RadioID == $originalfeature.RadioID){
return $feature.Radio_Install_Date
} else {
return Date()
}
Try incorporating a compare of the original value to the current value...Can make sure that if the RadioID isn't changed then the Install Date will not change. something like:
if (IsEmpty($feature.RadioID) || $feature.RadioID == $originalfeature.RadioID){
return $feature.Radio_Install_Date
} else {
return Date()
}
Hi @KimGarbade, thank you for the reply. Your recommended edit seems to work well for me, that is exactly what I was looking for. I appreciate your assistance!