You can save time collecting data and automatically calculate attribute values using the Editor widget with "smart" Forms. The Editor widget is available in Map Viewer and app builders such as Experience Builder and Instant Apps. The Forms builder is available in Map Viewer and Field Maps Designer; all you need is an editable feature layer.
If this is your first time, read this blog to get started building Forms.
Challenge
The values for fields with calculated expressions cannot be edited or recalculated on demand, while editable fields do not support calculated expressions.
Common use cases for the need to override a calculated value:
Workaround
Leverage field Logic in Forms to set dynamic behavior for editability based on a condition.
Open this sample Feature Layer in Map Viewer to view an example.
In the provided example, an editable feature layer has a Current Date field for which the value is automatically calculated based on the current date and time. Another field is used to define conditional editability for the Current Date field. If the Current Date field is editable, the date value can be changed. If the Current Date field is not editable, the date value is calculated and cannot be changed.
Follow the steps below to incorporate this field Logic into your editable layers.
Step 1 - Update your data schema
Note: This workaround may impact your data model as you may need to add a new field to your layer.
Step 2 - Add the calculated field to the Form
Step 3 - Add the conditional field to the Form
Step 4 - Add Logic for the calculated field
__________________
Special thanks to @ChrisFox, @DougMorgenthaler and the Field Maps team for sharing this approach.
You might also like
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.