Select to view content in your preferred language

Calculation Attribute rule not working Properly in FGDB

646
4
Jump to solution
08-15-2023 08:04 AM
Labels (3)
HarishKV
Occasional Contributor

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

2 Solutions

Accepted Solutions
SarahRijneke
Occasional Contributor

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.

View solution in original post

0 Kudos
HarishKV
Occasional Contributor

Thank you Sarah. I had nailed it out. Its working fine both in WebApp and FieldMap.

View solution in original post

0 Kudos
4 Replies
SarahRijneke
Occasional Contributor

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";
}

HarishKV
Occasional Contributor

Thank you Sarah. Do this rule work in the Work with Web App as well.

0 Kudos
SarahRijneke
Occasional Contributor

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.

0 Kudos
HarishKV
Occasional Contributor

Thank you Sarah. I had nailed it out. Its working fine both in WebApp and FieldMap.

0 Kudos