Edit a feature and automatically calculate a value in a featureclass based on a dropdown/user select

607
2
05-05-2022 12:24 PM
WilliamShuart
New Contributor II
 Is there a way to calculate attribute values of a hosted feature class based on a user selected value?  
 
Example: 
A user is editing a parcel or polygon of land use in a web app (widget) and I want the user to select a "value" from a list (type or value or something) or based on some other field (area maybe) in the attribute table based on multiplying/adding a pre-set amount. 
 
So, if a user creates a 2 acre parcel and it's agriculture, we multiply that by 3.2 and the value is: 6.4.  Whereas if that 2 acre parcel is business, it is multiplied by 1.5, resulting in a value of 3.  So, we'd have two values in the attribute table, the created value and the updated/adjusted value.
 
I know the attribute rules component of Pro can do some of this, but that is not available in the web.
 
Thanks in advance
0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

HI there, 

At 4.23, we added a support for contingent attribute values in FeatureForm: https://developers.arcgis.com/javascript/latest/release-notes/#featureform

You should be able to use this without having write a code to keep the integrity of your data.

0 Kudos
WilliamShuart
New Contributor II

Is there a sample that you can point me to?  Trying to figure out how the Arcade component would fit into this.  

In my example:  A user digitizes a polygon, selects a domain/subtype and then the arcade calculation updates a different field based on math/equation that is applied when the subtype is selected.  

0 Kudos