0

I have a hosted feature service that I overwrite on a nightly basis, this all works fine however I am having issues setting the parameter for "allow_exporting"

I set the value to True however after the update when I go into ArcGIS Online under item details the box is unchecked for allowing others to export.

I even set the parameter as allow_exporting = True but it still does not work. anyone see an issue?

arcpy.mp.CreateWebLayerSDDraft(mp, sddraft, sd_fs_name, 'MY_HOSTED_SERVICES', 'FEATURE_ACCESS',"my folder name", True, True, True, allow_exporting=True)

and also

arcpy.mp.CreateWebLayerSDDraft(mp, sddraft, sd_fs_name, 'MY_HOSTED_SERVICES', 'FEATURE_ACCESS',"my folder name", True, True, True, True)

both with the same results.... the document for this function is HERE

1

I discovered a BUG in ArcGIS Python API. This issue is now classified as:

  • **BUG-000116407 [Hosted Feature Service Settings (Export, Sync, and Edit) always set to False (unchecked) when overwriting a service using the CreateWebLayerSDDraft function in the ArcGIS API for Python].**

There is no workaround for this issue that I have discovered, other than manually enabling these options in ArcGIS Online.

| improve this answer | |
0

There's an undocumented 'Extract' option in the Service Capabilities which can be changed via the ArcGIS API for Python after you've carried out the republish.

syncLayers = []
# Dictionary without a key for 'capabilities' which will be added later
sync_update_dict = {'supportsDisconnectedEditing':'False', 'syncEnabled':'False',
               'allowGeometryUpdates': 'False', 'hasStaticData': 'False'}

# Search for and return the first Feature Layer Collection item based on relevance sorting
featureLayer = gis.content.search(query=featureLayerName + " owner:xyz", item_type='Feature Layer Collection', sort_field='relevance', sort_order='desc', max_items=1)
# Get the first result and create a Feature Layer Collection from it
featureLayerColl = FeatureLayerCollection.fromitem(featureLayer[0])
print(featureLayerColl.url)
syncLayers.append(featureLayerColl)

# Add capabilities key to dictionary. Access Tracks layer needs the extra 'Extract' option
# enabled for exporting the data in multiple formats
if featureLayerName == "AccessTracks":
    sync_update_dict["capabilities"] = "Query, Sync, Extract"
    sync_update_dict["syncEnabled"] = "True"

print(sync_update_dict)

for url in syncLayers:
    url.manager.update_definition(sync_update_dict) # comment out if not wanting to update
    url.properties.capabilities
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.