POPULATING DATE USING ARCADE

432
1
Jump to solution
04-11-2019 07:32 PM
Highlighted
New Contributor

Using ArcGISOnline and arcade I am wanting to populate a date field by adding 10 years to an Install Date field that is currently empty but will be filled out in the field using Collector for ArcGIS. The field I am trying to populate will be a WARRANTY_DATE field. The goal is for the user in the field to select and fill out the install date and it generates the warranty date then. Is this possible?

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Esteemed Contributor

In your case your data is dynamic since it is edited in the field. You can create an Arcade expression in the pop-up window of the map used in Collector and it will show up for the field worker and any app pointing to the same information. It is however a “virtual field” (it does not exist in the schema of the data).

 

You can use a field calculation in ArcGIS Online at the end of the field work to fill a real field with the warranty date. This will be a static result and will not update when the data is updated. If you would have access to ArcGIS Enterprise 10.6.1 or later, you would be able to define an attribute rule that is triggered by any relevant change in the data (creating a new feature, changing the install date on an existing one, etc).

 

If you don’t have access to Enterprise, try and define the Arcade expression in the pop-up of the layer in the web map used for Collector like this:

var install_date = $feature.LASTUPDATE;  // should point to your install date field
var warranty_date = DateAdd(install_date, 10, "years");
return warranty_date;‍‍‍‍‍‍‍

View solution in original post

1 Reply
Highlighted
Esri Esteemed Contributor

In your case your data is dynamic since it is edited in the field. You can create an Arcade expression in the pop-up window of the map used in Collector and it will show up for the field worker and any app pointing to the same information. It is however a “virtual field” (it does not exist in the schema of the data).

 

You can use a field calculation in ArcGIS Online at the end of the field work to fill a real field with the warranty date. This will be a static result and will not update when the data is updated. If you would have access to ArcGIS Enterprise 10.6.1 or later, you would be able to define an attribute rule that is triggered by any relevant change in the data (creating a new feature, changing the install date on an existing one, etc).

 

If you don’t have access to Enterprise, try and define the Arcade expression in the pop-up of the layer in the web map used for Collector like this:

var install_date = $feature.LASTUPDATE;  // should point to your install date field
var warranty_date = DateAdd(install_date, 10, "years");
return warranty_date;‍‍‍‍‍‍‍

View solution in original post