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

3190
5
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.

5 Comments
RichSikon

I agree.  The default field value should be editable.

I'd classify this as a bug and not a feature enhancement.

Is there any workaround that can be used now?

BrittanyBurson

Hi @RichSikon were you able to find a workaround?

RichSiko

Hi @BrittanyBurson my Case #02736976 has ben classified as a defect and is attached to the enhancement ENH-000137389

The workaround is to access the REST interface as the admin.  I haven't tried this yet but examining the json code I can see that there are multiple places where the default appears and it would need to be changed everywhere it appears.

Here is the workaround I was given:

Trippetoe

As a follow-up on the proposed work arounds, the approach to use the REST admin endpoint did not work for me. 

When i added a new field to my hosted feature layer, I set the field as nullable with a default value of 1.  Unfortunately, there is a bug in Arcade so that Arcade uses the default value when trying to set the field value to null (agreed that this is an edge case, but its the situation we are in with adding a new field to a many-year-old data set). Anyway, i tried to use the REST Admin endpoint to Update the Definition to remove the default value.  Despite the REST response reporting 'success', implying to me that the change to default value worked, the default value remained unchanged.  

My 'workaround' at this point is to add another new field, DO NOT set a default value, and then calc the values for the new field.

 

MiltonSolano

Definitely a necessary functionality for published layers. I tried the REST Admin endpoint workaround and doesn't work. ArcGIS Pro already have this tool: Assign Default to Field but it doesn't work with hosted feature layers.

It's incredible the amount of work one have to do to fix this behavior:

1. Arcade is showing the default value on records with null value

2. We have to create another field, do a field calculation, delete the previous field.

3. Reorder the new field on the popup window and FieldMaps form. Create calculated field from the new added field.

4. Edit labels on the map to show the new created field.

All of this for one single wrong default value. Please, implement this on the next AGOL release.