laptop and a wrench

Error

Null values for date fields are not calculated correctly in Map Viewer when using symbology from an Arcade expression.

Última publicación: January 3, 2023 ArcGIS Online
Número de ID del error BUG-000154016
EnviadoNovember 29, 2022
Última modificaciónAugust 23, 2024
Relacionado conArcGIS Online
Versión encontradaNovember 2022
Sistema operativoWindows OS
Versión de sistema operativo10.0 64 Bit
EstadoAs Designed

Información adicional

When a null value is passed to the Arcade Date function, it gets implicitly converted to the number 0. Date(0) will return the date based on the number of milliseconds since Jan 1 1970 UTC (in this case 0). To avoid this implicit casting, add null checks in the Arcade expression. Documentation on implicit casting: https://developers.arcgis.com/arcade/guide/type-casting/#implicit-number-casting Date function documentation: https://developers.arcgis.com/arcade/function-reference/date_functions/#dateepoch---date

Solución alternativa

Check for null values before creating the date and passing it into the DateDiff function:

var retire = $feature["dateField"]; //.

This is already a date field, and does not need to use the Date() function if (!IsEmpty(retire)) { return IIF(DateDiff(Now(), retire, 'days') >= 0, "retired", "active") } returns null.

Pasos para reproducir

ID del error: BUG-000154016

Software:

  • ArcGIS Online

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga