I have a feature layer with a datefield (inspection_date) and a domain field (maintenance).
The datefield gets populated by related records. When a related record is added the datefield (inspection_date) in the feature layer is updated using an attribute rule.
I would like the maintenance field (which is a domain) to automatically change to ‘inspection needed’ after 20 days of the datefield, by using an attribute rule. I have the following expression, but keep getting an error. Can someone help me out.
var numDays = 20;
var days = DateDiff(‘days’,Date(‘today’),$feature.inspection_date);
If(days > numDays, ‘inspection needed’, $feature.maintenance)