Hi there, I have a arcade expression to try to update FC from another one on the same webmap, so I get a error in the line three. help to correct this

598
1
08-25-2023 06:10 AM
JoseVeiga
New Contributor

var featureToUpdate = FeatureSetByName($map, "Area Lote", ["refcadastro", "estado"]);
var featureToCopyFrom = FeatureSetByName($map, "edicao_visualização", ["refcadastro", "estado"]);
var FeatureSetIntersects = Intersects(featureToUpdate, Buffer(featureToCopyFrom, 5, "meters"));
var matchingFeature = First(FeatureSetIntersects);
var UpdateFeature = FeatureSetByName($map, "Area Lote");

if (matchingFeature) {
var updatedValue = matchingFeature["refcadastro"];
return UpdateFeature(matchingFeature, {"estado": updatedValue});
}

return null;

0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

Two things that cause a problem.

Buffer takes a feature, not a feature set.

Intersects takes a single feature as the second input.