Add an attribute rule (calculation) to a feature service.

674
3
07-25-2019 03:12 PM
AshleyHayes2
New Contributor III

I would like to add an attribute rule (calculation) to a feature service so that it automatically takes information from field 'A', runs a simple Arcade expression, and populate field 'B' with the result. Specifically, I would like this to calculation to happen when users edit this feature service in ArcGIS Online.  When the user adds a new point to the feature service, ideally the attribute rule automatically takes the data input into field 'A', runs an Arcade expression, and populates field 'B' with the result of the Arcade expression. Is that possible for feature services or do I misunderstand attribute rules? I have attempted to access the Attribute Rules pane in ArcGIS pro to add the rule to the feature service, but I get a message indicating that the 'feature class corresponding to this view is read-only'. The feature service is 'editable' so what is meant by read-only? What am I missing? Thanks!.

0 Kudos
3 Replies
XanderBakker
Esri Esteemed Contributor

Hi Ashley.Hayes_TXDOT , 

Attribute rules at this moment are only available if the data resides in an Enterprise Geodatabase. Is that the case for your data?

0 Kudos
JianT
by
New Contributor II

I create attribute rule to a feature class, then publish the feature class to Portal as feature service. If I update attribute rule on the Feature class, will the attribute rule be updated automatically on feature service layer? Or need to overwrite the feature service to see the attribute rule change in feature layer?

0 Kudos
by Anonymous User
Not applicable

Does this work for ArcGIS Online features services? I have Workforce project for pothole repairs. When a pothole is added to the feature service on ArcGIS Online, I would like to calculate the DueDate field. I have created an arcade expression that calculates this field for a potholes feature class that exists on my computer. The expression searches for the nearest road (line feature class) and calculates the DueDate based on the Road Classification (i.e. if Road Class == 1, DueDateCreationDate + 5 days). The expression runs perfectly on my test data but I can't seem to get it to work with AGOL feature services - I get an Object not found error message.

0 Kudos