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

8263
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

Try to set the capabilities instead in the feature service admin API. It would do that same. Not sure if we have an issue with syncEnabled property. SyncEnabled property is the old way of enabling sync.

../rest/admin/services/testSubtype/FeatureServer/updateDefinition

Json:

{"hasStaticData" : false, "capabilities" : "Query,Sync"}

Khaled

0 Kudos
JimmyKnowles
Occasional Contributor II

That did the trick Khaled. I really appreciate your help.

0 Kudos
JimmyKnowles
Occasional Contributor II

Sorry to bother you guys again, but I'm getting 'sync replica internal error' when trying to sync. The syncs on all the other feature layers seem to be working fine, but Collector is returning this error on the dynamic join views. It seems that Collector is trying to sync these feature servers even though it is uneditable and there are no edits. I looked through all the other feature server properties and nothing jumped out at me that would tell Collector this is a download only sync (maybe set supportsAppend to false??). It seems like syncDirection is used when creating a replica, but is not a property of the feature server. Any ideas?

 

I did try enabling the 'Push Only' setting in Collector, but that didn't seem to help.

0 Kudos
KhaledHassen
Esri Contributor

Jimmy,

It looks like you might need to turn off sync in the collector for the join view service or customize the list of the layers to sync. Even though there might not be any edits, collector might try to sync its content with server data. 

Khaled

0 Kudos
JimmyKnowles
Occasional Contributor II

Khaled, thanks for the suggestion, but that doesn't seem to work. Or at least the way I tried to do it didn't work. I used ago-assistant to edit the json of my web map for use in Collector. I modified the capabilities of the join view layers. I tried both "Query, Extract" and "Query, Extract, Sync". When I do "Query, Extract", the web map will not download in Collector. When I use "Query, Extract, Sync", I'm getting "Unable to synchronize replica" errors. Any other suggestions? I read through most of the web map json spec and didn't find anything else.

Kanchana Karthikeyan‌ - did you have any of these issues when you implemented this?

0 Kudos
by Anonymous User
Not applicable

Hi Jimmy,

Please find attached a document I created that outlined the procedure I followed. Can you run through the steps and see if this works? You also need to ensure that the other layers are sync enabled. To isolate which layer is causing the issue, you might have to check layer by layer by adding it individually in the webmap and see if you are able to create the offline map and sync to the layer.

0 Kudos
JimmyKnowles
Occasional Contributor II

Thanks Kanchana. I looked through the pdf you shared and have been able to replicate everything outlined there. With Khaled's help, I was able to enable sync on all the join views (it appears that the procedure has changed slightly).

On the web map, the offline settings now show up under the item settings and 'Use in Collector for ArcGIS' is also there. I am able to download the web map, but when I sync the map I'm getting sync errors. I think this is where your workflow is different than mine. I am making edits in Collector and based on your pdf, it looks like you're using S123 to make edits. Since there are edits made in Collector, I want to be able to sync these edits. The edits seem to sync fine, but I'm getting errors since Collector is trying to sync these join views which are not technically syncable.

My join view has the following, which leads me to believe that I should be able to set the sync direction to download.

    "supportsSyncDirectionControl" : true, 

This setting allows the client application to set the sync direction, but I can't find in Collector where I would be able to set the sync direction. I guess an option is just to live with the sync errors since the actual edits are syncing fine.

Any ideas on how to get rid of the errors?

0 Kudos
KhaledHassen
Esri Contributor

Hi Jimmy,

I do not really see any solution except turning off the sync for the join layer in the map (if supported). Will be meeting with the offline team to see if we have a way to address this in the client side. Will update you shortly.

I might also need to do some design change in the feature service to avoid returning sync errors in the join feature service view.

Normally the client side (collector/etc.) keeps syncing even if one of the layers returns sync errors. Will be good if there is a way to turn off sync errors for the join layer.

Khaled

0 Kudos
JimmyKnowles
Occasional Contributor II

Thanks for the additional info Khaled. I've come to the conclusion that the client application (Collector in this case) does not allow for per layer sync direction control. It only allows some control on editableLayers and readonlyLayers, but not on individual layers. 

I think my best course of action is to implement as desired and ignore the errors for now. I'd be interested in hearing if any changes are made either on the client or server side. Thanks again for all your assistance.

0 Kudos
JimmyKnowles
Occasional Contributor II

So here's something that I just discovered. For each offline map in Collector, there's an info.json file. When I look at this file, it appears that the client (Collector) does set the sync direction by layer ('keyLayerSyncDirections'). For the join views in question, the sync direction is set to download, so not sure why these join views are generating sync errors. 

0 Kudos