Use Arcade Expression to Specify Default Value

2177
2
06-03-2021 01:26 PM
Status: Open
Labels (1)
JoshSaad
New Contributor III

When creating a field, you're limited to specifying a static value as the default value.  You can use Attribute Rules to change a value dynamically using Arcade Expressions, but the value can change depending on how the expression is configured.

If you set the value in the Attribute Rule when the feature is created, you can only change it after the feature is saved if you don't enable the attribute rule to run on feature updates.

It would be nice if you could use Arcade Expressions to set the default value but allow the user to change the value after it's been generated by the expression, without having to save first.  Let it suggest a value, but allow the user to enter a different value if they choose.

For example, I have a feature with a field for Start Date.  By default, I'd like it to enter the current date, but that wouldn't be the case every time.  The Start Date could be in the future, or it could have already started and the user is entering it after the fact.

Tags (2)
2 Comments
SarahHartholt

If you're just looking to set a default date of today this article might help How To: Specify the current date as the default value for a Date field when creating new features in....

How is this request different than setting the attribute rule to run on insert and then changing the date attribute later? Just trying to understand how this implementation adds value.

fklotz
by

Expanding on the original Idea: Currently using Arcade in a Field Maps Form allows creation of a "calculated value" not a "default value".  It does not allow the user to modify that calculated value.  The requested implementation adds value because it does not make sense to save a record with an incorrect value and then have all your users remember to re-open that record to change the incorrect value(s). This could be one field within a large number of fields, or it could be multiple fields.  It could be quite challenging for a user to even find which fields need to be corrected.  For a user to have to re-open the record to find the incorrect data and then update it will result in incorrect data submitted.  End users do not understand things like "you have to save the incorrect information first, then you can go in and change the value."

The date example listed by Josh is just one example of this issue.  The issue is not limited to dates.  The link provided by Sarah is a good solution for manual editing of data in ArcMap; it is not a scalable solution, and it does not work in ArcGIS Online or with ArcGIS Field Maps for data entry.