Select to view content in your preferred language

Arcade referencing original feature broken after update

527
16
Wednesday
jmaxwell_braun
Frequent Contributor

We are getting errors for fields with Arcade calculated attributes after the Field Maps 2025.2 update. It appears to only affect expressions that use the $originalFeature variable. The error message is vague: "10 attributes failed". Was there anything in the latest update that would cause this? Thanks

Edit: Esri has determined this is a bug. BUG-000179854, Description: The $originalFeature function fails when creating a new feature in ArcGIS Field Maps version 25.2, but editing the existing feature is successful.

16 Replies
CodyPatterson
MVP Regular Contributor

Hey @jmaxwell_braun 

Would it be possible to show a bit of the code? There may have been a depreciation that is causing this.

Cody

0 Kudos
jmaxwell_braun
Frequent Contributor

Hi Cody, here's an example.

//sets value of calculated coordinate field to null only if the location of the point is edited
//if only attributes are edited, the coordinates remain the same
if(!IsEmpty($originalFeature))
  if(Geometry($originalFeature).x != Geometry($feature).x)
    return null
  else
    return $feature.UTM_X
else
  return $feature.UTM_X
0 Kudos
DougMorgenthaler
Esri Regular Contributor

@jmaxwell_braun can provide some additional information to help us understand the issue a bit more.

  • What platform(s) are you seeing this error?
  • Occurring while using connected map, offline, or both?
  • Is the expression failing only when updating an existing feature?  
0 Kudos
jmaxwell_braun
Frequent Contributor

@DougMorgenthaler , it's happening on iOS with Field Maps logged into ArcGIS Online. Online only, have I have not tried offline. Seems to only happen when creating new features.

0 Kudos
DougMorgenthaler
Esri Regular Contributor

Thanks @jmaxwell_braun for the updated info. 

0 Kudos
IngridHogle
Frequent Contributor

The calls just started coming in from staff that multiple Arcade expressions are failing for us after last night's update, and they cannot work as a result. 😞 I'm not sure what to do so I'm posting here in hopes of adding some urgency to this situation. 

0 Kudos
jmaxwell_braun
Frequent Contributor

I opened Esri case number 04012489. For me it only affects certain expressions. For now I'm just disabling them so our field staff are able to work.

0 Kudos
DougMorgenthaler
Esri Regular Contributor

@IngridHogle can you please provide some additional details.  

  • What platform(s) are you seeing this error?
  • Occurring while using connected map, offline, or both?
  • Are the expressions being used in a pop-up, form, or elsewhere?
  • Can you share examples of expressions that are failing?
0 Kudos
IngridHogle
Frequent Contributor

I was able to identify that for us, anyways, it is sloppy Arcade expressions I wrote in forms that are causing errors in Field Maps 25.2.0. These are of two varieties:

1. In one Arcade expression, I declared a variable twice (var BlahBlah = "this", then later var BlahBlah = "that"). This worked without errors in Field Maps 25.1.0, but failed in 25.2.0. Removing the second "var" statement, so it reads var BlahBlah = "this, then later BlahBlah = "that", fixes the issue.

2. In multiple Arcade expressions, I invoked $originalFeature without first using an If statement to make sure I was within $editcontext.editType =='UPDATE'. This worked without errors in Field Maps 25.1.0, but fails in 25.2.0. It makes logical sense to me that it would fail, since $originalFeature does not exist (there is no original feature) in the context of $editcontext.editType == 'INSERT'.