AnsweredAssumed Answered

Auto calculate a date in ArcGIS Online

Question asked by MELLORJR@nt.dot.state.il.us_IDOT on Oct 4, 2019

I'm working with a hosted Feature Layer in ArcGIS Online.  I want to have an attribute for a StartDate that defaults to the current date when a Feature is created.  Then I want and attribute that is an EndDate and I want the EndDate to be 180 days from the StartDate.   This is what I want the expression to say;

 

var startdate= Date($feature["StartDate"]);

var SixMonths= DateAdd($feature["EndDate"], 180, 'days');

return SixMonths;

 

How can I automatically populate the EndDate when the StartDate is Not Null?

 

Outcomes