Here is my code to sum the length field times the width field to get the total area for line features.
var fs = $dataSources["dataSource_1-19d7400ea8f-layer-20"];
var total = 0;
for (var f in fs) {
var len_in_inches = f.Shape.STLength() * 12;
var width_in_inches = Number(f.Width_Inches, 0);
total += width_in_inches * len_in_inches;
}
return total;
I get the "Cannot access value using a key of this type." error, but can't figure out how to fix.