Arcade Field Calculations work when editing in ArcGIS Online, but not in Experience Builder?

223
3
Jump to solution
a month ago
Labels (1)
FranklinAlexander
Occasional Contributor III

I am trying to come up with an easy way for staff to add and edit data without having to use ArcPro because licensing and proficiency issues. Some field values, however, need to be auto generated for consistency, so I am using Arcade expressions in the ArcGIS Online web map to auto fill certain fields when records are created. The expressions work when using the ArcGIS Online Edit tool, but we cannot use ArcGIS Online because there is no way to add records to a table from the ArcGIS Online Edit tool. This is a huge problem! 

The work-around was to create an Experience Builder application because, the EXB Edit widget DOES allow for adding records to a table, but the Arcade expressions do not work!!  UUGGG!HHH!!!  I need to know if maybe there is some step I am missing, or if anyone has had similar frustrations and has some up with another solution. 

The field expressions were configured in ArcGIS Online using the Form tool. Here is an example of one of the expressions:

var pid = "P1"
var numArr = []
 
if (Count($layer) > 0 ){
  Console("Record count = " + Text(Count($layer)))
  for (var row in $layer) {
    Console("Property ID = " + row.PropID)
    if(!IsEmpty(row.PropID)) {
      var cn = Number(Split(row.PropID,'P')[1])
      Console("Split number = " + Text(cn))
      Push(numArr, cn)
    } else {
      Console("numArr count = " + Text(Count(numArr)))
      if(Count(numArr) == 0) {
        pid = "P2"
      }
      return pid
    }   
  } 
  pid = "P" + Text(Max(numArr) + 1) 
} 

return pid

 

This works as expected when I add a new feature from the Web Map:

Online Expression.PNG

But nothing happens when using the Experience Builder Edit widget

EXB Expression.PNG

If in fact Arcade Expressions are not compatible with EXB for field calculations, it would be nice to know if there are any plans to extend this functionality any time in the near future.

0 Kudos
1 Solution

Accepted Solutions
AlixVezina
Esri Regular Contributor

There were some limitations from the SDK side that have now been lifted, and adding support for the Forms in the Attributes-only mode is now possible but requires refactoring of the Edit widget. This is on the roadmap for an upcoming release.

View solution in original post

0 Kudos
3 Replies
AlixVezina
Esri Regular Contributor

Hi @FranklinAlexander , this is a known limitation right now.

The Forms you configured will not come through in the Experience Builder Edit widget when you use Attributes only mode, but it should work as expected if you use Geometry & Attributes when configuring the Edit widget.

AlixVezina_0-1711734529334.png

 

0 Kudos
FranklinAlexander
Occasional Contributor III

Thank you Alix, that's good to know and will save me some time. Do you know if Esri is working on this? It is a major limitation and forces me to create duplicate data, since now I need two layers with the same data, one with and one without geometry. Also, we are working in a testing environment and are just working with a couple of layers until we figure things out. This could get extremely complicated once we try and apply this in a more realistic scenario. 

0 Kudos
AlixVezina
Esri Regular Contributor

There were some limitations from the SDK side that have now been lifted, and adding support for the Forms in the Attributes-only mode is now possible but requires refactoring of the Edit widget. This is on the roadmap for an upcoming release.

0 Kudos