I have a map layer that I am using to create a list of features in an ArcGIS Online dashboard. The list is set up to display some basic data from each feature, but I want to use Arcade to add an extra line that shows when the feature was last updated.
The last update timestamp is stored as a string in each feature ('YYYYMMDDHHMMSS') in a field called "LastGPSUpdate". I've written an Arcade Expression that works when I manually plug in a string, but whenever I try to reference the actual data, it returns null values. In fact, all of the "$datapoint.XYZ" globals return null values.
Any assistance would be much appreciated!
var dateInitial = $datapoint.LastGPSUpdate
var yearParse = Left(dateInitial, 4)
var monthParse = Right(Left(dateInitial, 6), 2)
var dayParse = Right(Left(dateInitial, 8), 2)
var dateParse = monthParse + '/' + dayParse + '/' + yearParse
Console(dateParse, $datapoint.BattalionArea,$datapoint.Beat,$datapoint.DispatchGroup,$datapoint.LastGPSUpdate,$datapoint.StationArea,$datapoint.Team,$datapoint.UnitType)
return {
textColor: '',
backgroundColor: '',
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
dateText: dateParse
}
