laptop and a wrench

Error

Despite the validity of the expression, the calculation attribute rule is generating an error message in Arcade, specifically "ERROR 002717: Invalid Arcade Expression, Arcade error: Index out of bounds".

ArcGIS Pro
Número de ID del error BUG-000173875
EnviadoJanuary 27, 2025
Última modificaciónFebruary 12, 2025
Relacionado conArcGIS Pro
Versión encontrada3.4
Sistema operativoWindows OS
Versión de sistema operativo11.0 64 bit
EstadoAs Designed

Información adicional

This is as designed. Arcade is a programming language needing to be authored to handle errors. In this particular case, the first feature in the table, which is used by the expression builder for verification, happened to have a whitespace in "$feature.location" which passed the validation. However, when subsequent new features are created, they may have a location without a whitespace, which results in a split returning one element instead of two. This is why the rule sometimes works and sometimes fails. So, a guard logic must be added regardless.

Solución alternativa

Add error handling for cases where the locArray variable has 0 or 1 items. Refer to the example below.

"var MainLoc = text($feature.LOCATION)

var locArray = Split(MainLoc, " ")

if ( Count(locArray) < 2 ) { // error handling

 return

} else { // existing code

 var abrevTship = locArray[1]

 return abrevTship

}"

Pasos para reproducir

ID del error: BUG-000173875

Software:

  • ArcGIS Pro

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