Select to view content in your preferred language

How to use Arcade to make Null Geometry?

272
1
03-30-2025 06:53 AM
Labels (3)
Yogesh_Chavan
Frequent Contributor

Scenario:

There are two point feature classes (PointA, PointB). Both share a common field named ID.

Objective is to have an attribute rule on PointA, so that if we delete any feature from PointA the related feature in PointB should get Null geometry, but keeping the record in the attribute table.

How can we achieve this?

The script that we tried deleted the entire row from PointB, we would like to just remove features from Map, and keep the row in attribute table for PointB. 

Note: This is 1:M context, where we have Multiple PointB features with same ID as any given row ID in PointA.

var PointA = $feature.ID;
var PointB = FeatureSetByName($datastore, "PointB", ["ID", "GLOBALID", "created_user"], true);
var related_feature = First(filter (PointB, "ID = @PointA"));
console(related_feature)
if(related_feature != null){
var updates = [{
'globalID' : related_feature.GLOBALID,
'geometry' : Point({"x" : 0, "y" : 0, "z":0, "spatialReference" : {"wkid":4326}})
}];
return {
'edit' : [
{
'className' : 'PointB',
'updates' : updates
}
]
};
}

Any help on this would be highly appreciated!!

 

0 Kudos
1 Reply
JoshuaBixby
MVP Esteemed Contributor