Can't edit Hosted Feature Layer Domains in ArcGIS Online

4144
7
Jump to solution
08-10-2020 10:16 PM
by Anonymous User
Not applicable

Hi all,

Does anyone know why I cannot edit a hosted feature layers domains in ArcGIS Online?

Noticed there was a difference with the JSON for a Feature service that allows editing and the one I'm having trouble with.

FL I cannot edit 

FL I can edit 

Found that it may be to do with the highlighted fields in the troublesome Feature Layer here (

following this article here How To: Add coded value domains to a hosted feature service from a REST endpoint 

Does anyone know how to enable domain editing on this feature layer?

Thanks,

Cam

0 Kudos
1 Solution

Accepted Solutions
Stephanie_F
Esri Contributor

Hi Cameron McArtney‌,

I noticed that the hosted feature layer experiencing the issue has views. Is it possible that one of those views was created as the result of using the Join Analysis? If so, I believe you are running into a known limitation because a Join Analysis locks the schema for a hosted feature layer. In this scenario, deleting the view that was created through the Join Analysis should make source schema changes allowed again.

Hope this helps!

-Stephanie

View solution in original post

7 Replies
Stephanie_F
Esri Contributor

Hi Cameron McArtney‌,

I noticed that the hosted feature layer experiencing the issue has views. Is it possible that one of those views was created as the result of using the Join Analysis? If so, I believe you are running into a known limitation because a Join Analysis locks the schema for a hosted feature layer. In this scenario, deleting the view that was created through the Join Analysis should make source schema changes allowed again.

Hope this helps!

-Stephanie

by Anonymous User
Not applicable

Yeah it was due to the views!

Thanks Stephanie Foresman

CSR_GarinHirata
New Contributor II

Stephanie, 

I used to be able to update the source table domain that had a joined view, but it doesn't seem to be taking anymore. I get the successful message too. So I usually go through the REST endpoint and only insert the domain part I want to update. I want to keep my joined view because I don't want to redo my dashboard since the item id will change. I did notice that the "sourceSchemaChangesAllowed" : false. Do I need to change this only in the views and/or the source table too? Would this change let me change the domain? If so how would I go about that?  Thank You!

0 Kudos
SergioLugo_Serrato
New Contributor II

hi CSR_GarinHirata,

I have a problem similar to yours.

I tried as you said, using the REST endpoint of my layer view, I even specified ' "isViewOverride": true ' but it makes no change.
How do you add different domains to layer views?

Thanks!

0 Kudos
fklotz
by
Occasional Contributor

If you cannot update the domain values in a hosted feature layer and cannot figure out why your schema is locked, you may have hosted feature layer views created with the Join Features tool (this may also occur on 'regular' views).

If this is the case, you can enable the ability to edit the source data schema by updating the service definition on all views (or at least all views that are causing the locking).

To do this, you must go to the update service definition admin REST endpoint for the View (not for the Hosted Feature Layer) and update the two attributes.  When you look at the current service definition for the view you will find (maybe not in this order and may be not beside each other) that these will be set like so:

 

{
    "hasStaticData" : true,
    "sourceSchemaChangesAllowed" : false
}

 

You will want to update these attributes to the following:

 

{
   "hasStaticData" : false,
   "sourceSchemaChangesAllowed" : true
}

 

When using the update definition endpoint, remember that you need to also clear the editingInfo lastEditDate.  Set it to this:

 

"lastEditDate" : ''

 

Once you have updated the definition for each of the views which are locking your layer, you should then be able to edit the source data domains, add fields, etc.  Be careful not to edit anything that could break the view (deleting fields could be bad).

Once your schema is edited, you can re-set back to how ESRI expects your data to be by updating the view definitions with:

 

{
    "hasStaticData" : true,
    "sourceSchemaChangesAllowed" : false
}

 

The last time we did this (2023-02-17), the updated domains showed up automatically in the views.  Nice to see this as I don't think it used to be this way.

n.b. while the hosted feature layer itself does also have the "hasStaticData" and "sourceSchemaChangesAllowed", you cannot (at this time) edit these in the hosted feature layer.  They are controlled by the views.

post updated 2023-02-17

Farley
Tim-Woodfield
Occasional Contributor

Do you have to change these values back once done making changes? Is there a downside to leaving them as is to keep the main service schema editable? Can it corrupt anything?

mikAMD
by
Occasional Contributor II

Today, for some reason, "hasStaticData" is not going back to True even though I've changed this property for all the views, as I've done multiple times before.

Has this happened to anybody?

I'm wondering if this is causing me some problem that I encountered. What is "hasStaticData" anyway?

Thanks!

0 Kudos