Select to view content in your preferred language

FeatureLayerCollection.replicas.create always returns the correct tables but 0 records in the tables

281
0
yesterday
Labels (2)
Trippetoe
Frequent Contributor

Hi there. I have a python script that attempts to export a hosted feature service as a file geodatabase using the  python api's featurelayercollection.replicas.create() method. I am running python 3.11.10 and arcgis api 2.3.0

The service details:

- One feature layer (id: 0, geometry type: point) with attachments
- One related table (id: 1) with attachments
- Sync is enabled
- supportsSyncModelNone = true

The problem:

the replicas.create() operation consistently returns a file geodatabase with the correct schema but 0 rows in all tables, regardless of parameters used.

What works:

  • Using the AGOL Item Details page to Export as file geodatabase.
  • A direct query on layer 0 returns the expected 27 records
  • Running createReplica manually via the REST Services Directory HTML form returns the expected number of records

What I've have tried (all returning 0 rows):

  • syncModel=none with no geometry filter
  • syncModel=none with geometry set to the service's full extent
  • Adding layerQueries with where=1=1, useGeometry=false, includeRelated=true, queryOption=useFilter for both layers
  • syncDirection=bidirectional
  • geometryType=esriGeometryPoint
  • async=true and async=false
  • layers as comma-separated string (0,1) and as JSON array ([0,1])
  • using an empty querylayers
  • using a populated queryLayers with filter set to 1=1

Any thoughts on how to get the expected number of records returned?

0 Replies