Auto calculate a date in ArcGIS Online

100
0
10-04-2019 10:24 AM
John_RMellor__GISP
Occasional Contributor

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?

 

Tags (2)
0 Kudos
0 Replies