Feature services have a capability called Sync.
"capabilities": "Create,Delete,Query,Sync,Update,Uploads,Editing"
When the Sync capability is listed, the feature service is sync-enabled, and all layers and tables in the service can be used in sync workflows. If the Sync capability is not listed, the service cannot be used in sync workflows.
Feature service capabilities define the operations that are allowed when working with a feature service. The following two configurations are supported for feature services that participate in offline map use:
- Read-only data—If clients will only query the data they download from the feature service while offline, set the Query and Sync capabilities on the feature service. With this configuration, data cannot be synchronized back to the service.
- Editable data—If clients will edit the data when offline and synchronize changes with the feature service when they have connectivity, set Query and Sync with any combination of Create, Delete, and Update capabilities on the feature service.
Any other configuration will return an error when you download or synchronize the data.
To enable the Sync capability on feature services created with ArcGIS Server, you need to prepare your geodatabase in advance. An option to enable sync by editing item properties is also provided in Portal for ArcGIS and ArcGIS.com for hosted feature services.
For sync-enabled feature services, an additional sync
property describing the following supported features is provided:
- Synchronization direction
- Layer-level sync
- Asynchronous operation
- Registration of existing data
- Rollback on failure
If supports
is true
, the create
operation has a replica
parameter that supports registering existing data. This allows a replica to be created based on an existing replica. Example 3 in the workflow examples describes a workflow where this option is used.
If supports
is true
, the service will allow control of data sync direction. The default is bidirectional. Other directions are upload, download, and snapshot.
If supports
is true
, layers can be synchronized independently, and the service will accept a value of per
for the sync model during the create
operation. If supports
is false
, the only sync model supported is per
.
If supports
is true
, the layers can be synchronized together, and the service will accept a value of per
for the sync model during the create
operation. If supports
is false
, the only sync model supported is per
.
If supports
is true
, the service can execute sync operations asynchronously.
If supports
is true
, the rollback
parameter can be set to true
or false
when running the synchronize
operation. If supports
is false
, the synchronize
operation does not support the parameter.
JSON syntax for feature service properties related to Sync
{
"currentVersion": <currentVersion>,
"syncCapabilities" : {
"supportsRegisteringExistingData" : <true | false>,
"supportsSyncDirectionControl" : <true | false>,
"supportsPerLayerSync" : <true | false>,
"supportsPerReplicaSync" : <true | false>,
"supportsRollbackOnFailure" : <true | false>,
"supportsAsync" : <true | false>,
}
...
}
JSON response example
{
"currentVersion": 10.21,
"syncCapabilities":{
"supportsRegisteringExistingData": true,
"supportsSyncDirectionControl": true,
"supportsPerLayerSync": true,
"supportsPerReplicaSync" : false,
"supportsRollbackOnFailure" : false,
"supportsAsync": true
}
...
}