ArcGIS Pro: Advanced Attribute Appending

3731
15
Jump to solution
01-31-2020 12:17 PM
by Anonymous User
Not applicable

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 {}

0 Kudos
15 Replies
by Anonymous User
Not applicable

Xander Bakker

The two expressions you have provided are valid, but they return no field value. As I stated earlier, when I use a the Prg_SignalInvnet_Cabinet feature class it will return that "The type does not support the function first". 

The MACOG_ID value is just a list of values that I assume satisfies the type, but the idCabinet value is a unique ID that is generated by the NextSequenceValue function In the form of an attribute rule in the Prg_SignalInvnet_HandHoles feature class. I am making an assumption that because the Attribute Rule is enabled that the values generated do not satisfy that Type due the NextSequenceValue function being enable in the Prg__SignalInvent_HandHoles feature?

Further for the inheriting of the unique ID in the idCabinet field from the Prg_SignalInvent__Cabinet feature to the idCabinet field in the Prg_SignalInvent_HandHoles feature, does there need to be / can the relationship be added (with being an established relationship class of Prg_SignalInvent_Cabinets_Has_Prg_SignalInvent_HandHoles) via an attribute rule that fires on insert / creation of a new Hand Hole point and populates the Prg_SignalInvent_Cabinet_GUID in the Prg_SignalInvent_Handholes feature so that a relationship is created to satisfy the FeatureSetByRelationshipName or would it be possible that as long as there is a relationship class created between the features (ie. Prg_SignalInvent_Cabinets_Has_Prg_SignalInvent_HandHoles) does that satisfy the function. 

Apologies if this is a goose chase, I appreciate the help though.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Brian.Acheff ,

What versions of the software are you using for all the components that are using here?

0 Kudos
by Anonymous User
Not applicable

Xander Bakker
I am currently running ArcGIS Pro 2.5 Advanced 

0 Kudos
by Anonymous User
Not applicable

I came across feature templates and relationship classes in ArcGIS Pro reading this documentation Feature templates—ArcGIS Pro | Documentation 

Literally says reduced the need to use the “ ADD NEW TO RELATIONSHIP” option. 

Many thanks, I appreciate the help, was able learn a lot about ARCADE, Attribute Rules, ArcGIS Pro in general and much more during this goose chase along with feeling more confident as a user and in learning developer skills.

0 Kudos
RobertKrisher
Esri Regular Contributor

Wait...was this whole thread about wanting to create one point/line feature with a bunch of features with a predefined set of attributes?  Oh man, if that's the case I'd 1000% recommend using feature template with related tables (for a point/line with related objects) or for a predefined set of related features i'd use the preset template.

by Anonymous User
Not applicable

Yes you are correct. 


I assume Attribute Rules and ARCADE along with some Python are to be used in conjunction with the templates for various asset identification/ inventory, various editing scenarios, QA/QC and further automation if it makes sense and is necessary depending on the overall goal of the program, application or map.

0 Kudos