Trying to do some looping in Arcade label expression in Pro.
First, the following script works fine on a hosted feature layer, but on a feature class in a file geodatabase, it only returns the first field (ObjectID).
function countAnalyte(){
var allFields = []
for (var j in $feature){
Push(allFields, j)
}
return allFields
}
Second, I want to iterate through fields and build field names dynamically. I have a feature class with columns: AName1, AResult1, AName2, AResult2. The feature class may have unspecified numbers of these repeats. I want to build it so I can iterate on the number, and use each set of "AName" and "AResult" fields and their values to build the label expression. Something like this:
var acount = [1,2,3]
for (var i in acount){
$feature.AName+i //use value for exp
$feature.AResult+i //use value for exp
}
@XanderBakker any help is greatly appreciated!