Arcade: Use related FCs without needing feature service

531
3
03-05-2022 09:35 PM
Bud
by
Notable Contributor

I'm hoping to use related FCs in calculation attribute rules.
For example, use an attribute rule in FC-A to update the features in FC-B.

Question:
In order to use related FCs in attribute rules, do we need to publish the FC as a feature service?

 

 

 

0 Kudos
3 Replies
KimGarbade
Occasional Contributor III

Good Morning... If this is what you are referring to I don't think the data has to be coming from a feature service.  The sample data referenced in the article is just a file GDB.

https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/advanced-gdb-attribute-rules-ed...

MikeMillerGIS
Esri Frequent Contributor

I believe if you use FeatureSetByName  with $datastore and ensure you check Exclude from Client Evaluation, the rule will search the database for the FC.  You may not be able to use the FeatureSetByRelationshipName.  So you will just have to built the query using PKey/FKey values.

 

Something like this:

https://github.com/Esri/arcade-expressions/blob/master/attribute_rule_calculation/MoveFieldToParent....

Bud
by
Notable Contributor

Thanks for your help Mike and Kim. Your replies helped a lot.

 

As Mike said:

var parent_class = FeatureSetByName($datastore, "Facilities", ["globalid"], false);

FeatureSetByName

FeatureSet

Global Variable: $datastore

Bud_1-1646720722636.jpeg

Idea: Arcade Documentation: Arcade FeatureSets / related FCs


And this will probably be useful: 

$editcontext.editTypeTextIndicates whether the edit event is INSERT, UPDATE, DELETE, or NA (not applicable).


Identify the editing event trigger such as insert, update, or delete

0 Kudos