I'm trying to use an Arcade calculation attribute rule in a line feature to add records to a related table. The related table also has an Arcade calculation attribute rule that I want to be triggered when the line feature rule adds the records to the table.
Additionally, the rule in the table will use data added by the rule in the line feature in the calculation.
So far, the rule in the line feature to add the records to the related table is working, but it looks like the rule in the table is not being triggered by the added records. Is this cascading of rules possible in Arcade?
You can indirectly "call" attribute rules by performing edit operations (insert/update/delete) on the class that has an attribute rule defined. This can be manually editing the records or using an attribute rule from a different class with the edit keyword. Attribute rule dictionary keywords—Geodatabases | Documentation
If you manually edit your related record table, does the attribute rule execute?
Thanks for the reply. I had an error in the table's rule code and that was the reason it was not working like I expected, but after the correction the rule in the related table was triggered by returning a dictionary adding records to the table from the feature rule, as you indicated above.
I've been trying to do something else with Arcade in the electric utility network (Arcgis Pro 2.5, UN 3.3, Arcgis Enterprise 10.8), but I'm not sure if it's possible. I have a group template with a pole (main feature of the template), electrical attachment and a medium voltage line. The group template also creates the attachment association between the pole and the electrical attachment. I have an Arcade rule in the pole feature that tries to update the data in the electrical attachment returning a dictionary when the group template is inserted. To ID the electrical attachment associated with every pole I'm using FeatureSetByAssociation (https://www.esri.com/arcgis-blog/products/utility-network/data-management/featuresetbyassocaitions-n... ) But this function is not returning any feature set associated with the pole.
The question then is if the associated features are available to the Arcade rule when the group template is being inserted? I was able to use FeatureSetByAssociation after the group template was created, triggered by an update to the pole, and the rule was able to ID'ed the electrical attachment.
I would look at moving from a group template and generating the features in Arcade. You could generate the attachment to the line to the closest vertex, generate the attachment and build the association all in one rule. Here is an example:
One great advantage to the method Mike has shown you is that if you are using the UN in a Service, then this operation always executes. It is not dependent on the client. So if you added a pole from a web app, the connection point would be automatically created, even though no template was used.