I'm trying to use an Arcade script to generate dynamic text:
var selectedFeatures1 = $dataSources["dataSource_1-19934af200d-layer-22-19934afbfb4-layer-23-selection"].selectedFeatures;
var cnt = Count(selectedFeatures1);
if (Equals(cnt, 0)) {
return 0;
}
return Average(selectedFeatures1, "st_area(shape)");However, this causes the error "Function not recognized" to print to the console. If I use a numeric field with no parentheses, the average is calculated correctly. I've tried to escape the parentheses with backslashes, but the error persisted. Is there some other way to properly escape the field name?
I know I can just use the Dynamic Content -> Statistics functionality, but that shows the function name when no features are selected, and I'm also looking to write some custom calculations.