Allow Default Value to be removed or changed in Hosted Feature Service Field View

24897
37
11-01-2019 10:09 AM
Status: Open
by Anonymous User
Not applicable

At this time, if you set up a Default Value for a field upon creation of a Hosted Feature Service, you have to delete and re-create the field to remove the default value.

Please allow the functionality to re-configure the Default Value of a field post hoc.

37 Comments
MikeMinami

@JCooley_ClackamasSWCD 

My understanding is that feature templates are stored on the Feature Service. Thus, they would only need to be authored once and would be available in any map. View layers also inherit feature templates.  You bring up an interesting case when a particular field from the source layer is hidden in the view. Where does the default value come from? I'm not sure, but perhaps the field default as you say.

Bud
by

For any AGOL novices like me:

It looks like it's possible to change a default value in a Survey123 form UI, but not in the underlying hosted feature layer settings.

Bud
by

@MikeMinami , regarding your comment.

If you want to set the default value for a field, you need to do so on the feature template used to create features. Map viewer classic supported creating and editing feature templates, and now so does Map viewer. Check out this blog post for more information.

The long answer is that the default value on a field (stored on the service) has somewhat limited utility because it gets overridden by a subtype default value and feature templates.  Even if we support changing the default value on the field, it doesn't propagate to feature templates. When you add a new feature and use a feature template, the feature template has its own default value. Now, you might think, updating the default value on the field it should also update the default value on the template. We don't do that because you may have explicitly set the default value on the template that's appropriate to the defined feature.

Like others, I suspect it would be useful to be able to change the default value in a feature layer, for groups who don't use feature templates. And if people do use feature templates, then it's up to them to change any default values in the templates if needed; that's just part of normal business when we have user interfaces/front ends (like feature templates).

 

ToddW_stl

cross posting from another idea, since this idea was mentioned there... https://community.esri.com/t5/arcgis-online-ideas/calculated-default-value-in-hosted-feature-layer/i... 

 

I have a simple hosted feature service that I was able to change the default value of a simple Yes/No question by editing the feature template.  Note I did not sync the template with the layer style and was able to save the new default value.  This idea still may be valid, if the desire is to use Arcade expressions to calculate default values, but I wanted to provide a potential workaround to help people in the meantime. 

ToddW_stl_0-1770742027752.png

ToddW_stl_0-1770742140449.png

hkomm
by

Hi ESRI, just checking in — is there any status update on this enhancement request (ENH-000137389)? Thanks!

ToddW_stl

@hkomm - ENH-000137389 specifically was Closed with the reason "Will Not Be Addressed".  I would encourage everyone that thinks they need this to log a case with Esri Technical Support that can be attached to this enhancement with your specific use case and justification for why known workarounds are insufficient.  I also see a "related" ENH-000124414 that was Closed with the reason that it's a "Known Limit".  The public explanation is that "In order to maintain data integrity, ArcGIS Feature layers prevent schema changes such as default values and changing the null values. It is recommended to create a new field and move the data to the new field with the changes if a schema change as described in this Enhancement is needed."

Bud
by

I imagine someone's said this already, but I believe you can do this with the Admin REST API.