ArcGIS Online Layer Data Default Value Not Saving

2677
7
Jump to solution
03-07-2019 07:16 PM
ZacharyStauffer
New Contributor

Hello,

I have a feature layer stored in my ArcGIS Online gallery that I am attempting to add an additional data field to. I accessed the layer by browsing to it in my gallery, then navigating to Data > Fields > Add. In the Add Field dialog box I entered the following values:

Field Name: INFO

Display Name: INFO

Type: String

Length: 512

Default Value: No Additional Information

Unique: No

When I hit the Add New Field button the field appears in the list but when i click on it to view the details it says None for Default Value. I also checked to see if the default value populated in the table but it did not.

Any help with this would be greatly appreciated.

1 Solution

Accepted Solutions
MikeMinami
Esri Notable Contributor

There is an issue displaying the default value on the Field Details page. It always shows none currently. This will be addressed in our next update, later this month.

Adding a new field and configuring a default value will not set that default to all existing rows in the layer. You can calculate the field if you want to set a value. The default value will appear in the popup when adding a new record. Note, however, that you can override the field's default value by defining a different one when defining a feature template for editing.

Mike

View solution in original post

7 Replies
KellyGerrow
Esri Frequent Contributor

Hi Zachary,

When using the edit button in map viewer, are you able to see the default value when you add new features?

Mike Minami

-Kelly

0 Kudos
MikeMinami
Esri Notable Contributor

There is an issue displaying the default value on the Field Details page. It always shows none currently. This will be addressed in our next update, later this month.

Adding a new field and configuring a default value will not set that default to all existing rows in the layer. You can calculate the field if you want to set a value. The default value will appear in the popup when adding a new record. Note, however, that you can override the field's default value by defining a different one when defining a feature template for editing.

Mike

View solution in original post

MatthewStull1
Occasional Contributor

I just ran into this same problem with the Default Value still saying "None". Here is what I did:  I downloaded my Feature Layer (from ArcGIS Online) to a File Geodatabase and changed the default value of my "Status" field to "Submitted" in my feature class.  I then published the File Geodatabase back up to ArcGIS Online and didn't see the change reflected there.  Can you confirm whether this issue got fixed yet?  You posted this message in March saying it would be fixed "later this month".  I'm posted this on May 6th.  Thanks for you help!  

0 Kudos
MikeMinami
Esri Notable Contributor

The issue was addressed. It was simply a display issue in ArcGIS Online, where the field's default value was not being displayed.

I am able to reproduce your problem, but it appears to be a separate issue. I believe when the FGDB gets published, the default value gets ignored during publishing.  I'll write up an issue on this. You can check your hosted feature layer to see if the default value is null.

  1. From the overview tab of the layer, click to the View link in the URL section on the bottom right of the item details page.
  2. On the service directory page, click the layer name.
  3. Click the JSON link at the top of the page (very small link)
  4. Find your field, I suspect the default value will be null.

name: "Amount",
type: "esriFieldTypeInteger",
alias: "",
sqlType: "sqlTypeOther",
nullable: true,
editable: true,
domain: null,
defaultValue: null

If your goal is to provide a default value for the field when people edit it, a better approach is to set the default value on the feature template as described here https://doc.arcgis.com/en/arcgis-online/manage-data/manage-feature-templates.htm#ESRI_SECTION1_AF343...

Feature templates control a field's default value during editing via templates, which is the way features get added to the map.

hope this helps,

Mike

MatthewStull1
Occasional Contributor

Thanks Mike, that was very helpful!

0 Kudos
NaomiBegg2
Occasional Contributor III

Hi Mike Minami‌  I'm trying to create a default value for a field within an existing hosted feature service.

Within the Data Field information there is an edit button next to 'Unique' and the Domains but not for Default Value.

How do I set the default value for this either in the actual field or by using editing tools within webapp builder?

0 Kudos
MikeMinami
Esri Notable Contributor

Changing the default value on a field, once set, is not supported.

Having said that, the default value when new records get added is primarily controlled by feature templates as described here.

https://doc.arcgis.com/en/arcgis-online/manage-data/manage-feature-templates.htm#ESRI_SECTION1_AF343...

I believe if you set these up, the editing tools in all apps will use the templates.

Mike

0 Kudos