Select to view content in your preferred language

Automatic attribute value transfer through attribute rules?

647
5
Jump to solution
05-25-2023 11:21 AM
MaikHeinze
New Contributor II

Hey,

Is it possible to automatically transfer an attribute value from a line to a component when attaching the line to the component using an attribute rule?

Kind regards

0 Kudos
2 Solutions

Accepted Solutions
TobeyKane-Seitz
New Contributor III

Yes - you can do this using an intersection of the two features 

View solution in original post

BrianBulla
Regular Contributor II

It really depends on how you are doing it, but you can use a dictionary to make the final field/fields update:

https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-k...

So something like this:

//first get the intersecting grid
var gridNo = FeatureSetByName($datastore, "LAND_Grid", ["GRIDNO"], false);
var intersectingGrid = first(intersects(gridNo, $feature));

var seqNo = NextSequenceValue("SeqManholes");

var depotArea = FeatureSetByName($datastore, "LAND_DepotArea", ["DEPOTAREA"], false);
var  intersectingDepot = first(intersects(depotArea, $feature));

return{
      "result" : {
         "attributes" : {               
               "FACILITYID" : "MH-" + intersectingGrid.GRIDNO + "-" + seqNo,               
               "DEPOTAREA" : intersectingDepot.DEPOTAREA,                              
                        }
                 }
      }

View solution in original post

5 Replies
TobeyKane-Seitz
New Contributor III

Yes - you can do this using an intersection of the two features 

BrianBulla
Regular Contributor II

I would say "Yes", but depending on what you are doing will determine the best way to do it.  For me, I have the rule on the point feature, and I take an attribute from the intersecting feature (a polygon) and get the  attribute value from the polygon this way.....then just add it to the point.

var depotArea = FeatureSetByName($datastore, "LAND_DepotArea", ["DEPOTAREA"], false);
var  intersectingDepot = first(intersects(depotArea, $feature));

 

This will add the value of the depotArea field to the feature.  This triggers when the feature is created.

MaikHeinze
New Contributor II

Thank you very much for the answers.

I have adjusted the expression for my purpose. However, it does not fill the field or update it. How can I update the value or should it update automatically?

Here is my intention:

The address point has the attribute field called "Wohneinheiten". When connecting a cable to this address point, the value from "Wohneinheiten" should be overwritten into the attribute field called "Info" in the cable. How can this value be updated?

0 Kudos
BrianBulla
Regular Contributor II

It really depends on how you are doing it, but you can use a dictionary to make the final field/fields update:

https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-k...

So something like this:

//first get the intersecting grid
var gridNo = FeatureSetByName($datastore, "LAND_Grid", ["GRIDNO"], false);
var intersectingGrid = first(intersects(gridNo, $feature));

var seqNo = NextSequenceValue("SeqManholes");

var depotArea = FeatureSetByName($datastore, "LAND_DepotArea", ["DEPOTAREA"], false);
var  intersectingDepot = first(intersects(depotArea, $feature));

return{
      "result" : {
         "attributes" : {               
               "FACILITYID" : "MH-" + intersectingGrid.GRIDNO + "-" + seqNo,               
               "DEPOTAREA" : intersectingDepot.DEPOTAREA,                              
                        }
                 }
      }
MaikHeinze
New Contributor II

Where can I find the geometry of the cable and the address point? Do I need to create a geometry field for each respective feature, or is the geometry stored somewhere else? If I do need to create a geometry field, what field type should I use for it?

Kind regards

0 Kudos