Hi,
I want to write an attribute rule to add a value to the attribute field if the feature is intersecting with other layer. Both are polygon layers and I had written an arcade expression but it is not returning any result as expected. Below is the expression
var intersectingFeatures = Intersects($feature, FeatureSetByName($datastore, "SurveyPlot2"));
if (Count(intersectingFeatures) > 0) {
$feature["rule"] == "1";
} else {
$feature["rule"] == "0";
}
return $feature;
Can anyone help me debug the issue
Solved! Go to Solution.
Depends on which app you're using. You can set up arcade calculate expressions in Field Maps Designer that should produce the same results when adding new features to a feature service.
Thank you Sarah. I had nailed it out. Its working fine both in WebApp and FieldMap.
Assuming you are running your calculation on an attribute named rule:
var intersectingFeatures = Intersects($feature, FeatureSetByName($datastore, "SurveyPlot2"));
if (Count(intersectingFeatures) > 0) {
return "1";
} else {
return "0";
}
Thank you Sarah. Do this rule work in the Work with Web App as well.
Depends on which app you're using. You can set up arcade calculate expressions in Field Maps Designer that should produce the same results when adding new features to a feature service.
Thank you Sarah. I had nailed it out. Its working fine both in WebApp and FieldMap.