Overwrite a Feature Service used in Join Features as Hosted Feature Layer Views

7976
38
Jump to solution
02-01-2019 03:57 AM
AnthonyJonesRSK
Occasional Contributor II

I recently read the article from Paul Barker titled Bring your data closer together: Save analysis results from Join Features as Hosted Feature Layer Vi.... This is a really useful feature but I'm having trouble overwriting my feature services that are used in the join, where a hosted view is created. In the post Paul mentions that "feature layers that participate in view layers with joins cannot have their schema altered and are always read-only and cannot be used offline.". Does the feature layer being read only mean that it can't be overwritten?

Whenever I try and overwrite my feature service in Pro it simply says Failed to publish web layer. I then find that the data tab for my hosted view just says Data Error. Note that when I'm trying to overwrite my feature service the schema is exactly the same.

It would be a shame if this can't be done as one of my features used in the join is updated on a weekly basis so overwriting is the best way to keep this up to date online.

Any help with this would be much appreciated.

Thanks

Anthony

38 Replies
KhaledHassen
Esri Contributor

Even download sync direction is not supported on view join layer. We are working on a snapshot sync direction that can be supported on join view layer. But no timeline for this enhancement yet.

Khaled

0 Kudos
JimmyKnowles
Occasional Contributor II

Got it Khaled. Thanks for the info. That makes sense. Just trying to wrap my head around how everything works internally.

0 Kudos
by Anonymous User
Not applicable

Hi Jimmy,

I want to clarify. In my example I am using the join layer only to visualize information in the Collector map in an offline fashion. I am not editing the join layer.  You cannot edit the join layer. However, if you are trying to make edits to another feature layer/ hosted feature service in the map and use the join layer only for visualization, then you can enable sync and it should work as expected.

At this point, I do not have information on how you have configured the other non-join layers in the map. Let's start fresh.

To Khaled's point, can you try to isolate the layer that is causing the sync issue? To cross-validate that it is not the join layer that is causing the issue, add only the join layer to a NEW map along with a dummy fully editable hosted feature service and test the going offline and sync scenario. Please use a new map, as I understand that you have edited the map JSON and that may be causing the issue.

  • If it works fine, then it is not the join layer causing the issue. You might have to check the settings in the other layers. Please follow the same steps above to isolate that issue causing layer.
  • If it is not working fine, create a new join and sync enable from scratch using my document as reference, and see if that solves the issue you are facing.
0 Kudos
JimmyKnowles
Occasional Contributor II

Hi Kanchana, I fully understand that I can't edit the join layer. Yes, the difference b/w my use case and yours is that I am making edits to other feature layers in the same web map that the join layers are in and my need to sync is what is causing the sync errors. I have confirmed this by doing what you said. I created a dummy feature service and a new join which I enabled sync on. I then added both to a new web map to confirm the behavior. In the Android version of Collector, the error provides which layer is not syncing and it is the join layer. It appears that Collector still tries to run the synchronizeReplica operation on the join layer even though it is not editable and there are obviously no edits.

I tried to disable editing on the join layer to force Collector not to run the synchronizeReplica operation, but this doesn't appear to work either. It looks like the web map disables editing by adding a capabilities property to the layer in the operationalLayers object.

"capabilities": "Query,Extract,Sync,ChangeTracking"

When I add a capabilities property to the join layers in the operationalLayers object, I either can't download the map or it still errors when syncing. I've tried it without 'ChangeTracking' as well since ChangeTracking would not be a valid capability for the join layer, but it didn't work either. 

As I mentioned in my response to Khaled, I think my best course of action is just to live with the errors for now. Thanks again for your help.

0 Kudos
by Anonymous User
Not applicable

@Anonymous User 

Is it possible to do this with a join layer for Field Maps? I've got a join layer (hosted view) between features and inspections (related records). I want to symbolise via a field in the related record which works fine if I'm online. It just won't let me take the map offline with the join layer included in the web map (classic version). There'll be no editing of the hosted view, I just need to be able to take it offline to show users the latest related information which I don't have on the parent feature layer.

0 Kudos
kawakawa4
New Contributor III

Hi @KhaledHassen or @JimmyKnowles , in what part of the Json does this need to be added: {"hasStaticData" : false, "capabilities" : "Query,Sync"} ?

0 Kudos
KhaledHassen
Esri Contributor

You need to use admin service updateDefinition.

Ex: 

https://.../ArcGIS/rest/admin/services/<myservicename>/FeatureServer/updateDefinition

and then pass the json above. Pl. note the sources of the view needs to have sync enabled.

Thanks

Khaled

 

by Anonymous User
Not applicable

Has this been fixed? With Map Viewer Classic I can add a Hosted Feature layer view, which is a join between the feature layer and the related records, but I can't take the map offline in Field Maps. If I remove the hosted view I get back the offline functionality and I can take it offline. I don't need the Hosted Feature layer view for anything but symbolising the features according to the related records in the join. I do need to still be able to edit the related records of the feature layer (not the view).

0 Kudos
JimmyKnowles
Occasional Contributor II

@Anonymous User  - the last time we needed to do this, we still needed to manually update the layer definition to be able to take join layers offline. That was back in May, but I don't think anything has changed since then. It worked with Field Maps, but will return errors when you try and sync. Despite the errors saying that the sync failed, all other layers should sync fine.

The actual json that you need to update is in Khaled's response...

https://community.esri.com/t5/arcgis-online-questions/overwrite-a-feature-service-used-in-join-features/m-p/40896/highlight/true#M1968