Attempting to append existing field values from and existing feature class to empty field values in features on creation for an array of various related feature classes.
To be more specific I have many traffic assets that all relate back to a Cabinet, so every time a feature that is related to the Cabinet (ie. signal head, handhole, signal pole ect.) I want to append the Cabinet_ID and other field values.
the goal is for this to perform edit users who are collecting field points or users that are digitizing over aerials.
My initial trail with attempting to mimic the filed mapping with ARCADE and Attribute Rules is described below.
I know that the return expression would involve this snippet if replicating the Field Mapper return expression
-------------------------------------------------------------------------------------
return {
"idCabinet" : $sourceFeature['idCabinet']
}
--------------------------------------------------------------------------------------
I am trying to work with a different script that generates by intersect the source field value to the target field; it is also part of an Attribute Rule
-----------------------------------------------------------------------------------------------------------------------------------------------------------
var fsMACOG_Intersections_Poly = FeatureSetByName($datastore, "MACOG_Intersections_Poly", ["MACOG_ID"])
var fsMACOG_Intersections_PolyIntersect = Intersects(fsMACOG_Intersections_Poly, $feature)
var MACOG_Intersections_Poly = First(fsMACOG_Intersections_PolyIntersect)
if (MACOG_Intersections_Poly == null) return {"errorMessage": "MACOG_ID not found"}
return MACOG_Intersections_Poly.MACOG_ID
-----------------------------------------------------------------------------------------------------------------------------------------------------------
tinkering around with the ARCADE Sandbox, the script currently looks like this
-----------------------------------------------------------------------------------------------------------------------------------------------------------
var fsPrg_SignalInvent_Cabinet = FeatureSetByName($sourcefeature, "Prg_SignalInvent_HandHoles", ["idCabinet"])
var fsPrg_SignalInvent_HandHoles = FeatureSetByName($targetfeature, "Prg_SignalInvent_HandHoles", ["idCabinet"])
if(isempty($targetfeature.idCabinet))
return {
"idCabinet" : $sourceFeature['idCabinet']
}
else return {}