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:
But nothing happens when using the Experience Builder Edit widget
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.