• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • Synchronization
    • CSPro Statements and Functions
    • Text Templates
    • Templated Reporting System
    • HTML, Markdown, and JavaScript Integration
    • Action Invoker
      • Overview
      • Execution Environments
      • Security, Resource Management, and Formatting Options
      • Base Actions
      • Application Namespace
      • Clipboard Namespace
      • Data Namespace
        • Data Action Invoker Namespace
        • Data.close Action
        • Data.contains Action
        • Data.countCases Action
        • Data.deleteCase Action
        • Data.getCurrentCase Action
        • Data.getSyncStatus Action
        • Data.getSyncStatus Action Examples
        • Data.open Action
        • Data.query
        • Data.queryCases Action
        • Data.queryKeys Action
        • Data.readCase Action
        • Data.sync Action
        • Data.writeCase Action
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • Logic Namespace
      • Message Namespace
      • Network Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • Sync Namespace
      • System Namespace
      • UI Namespace
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataManager>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Data.getSyncStatus Action Examples

The following examples show how to use the Data.getSyncStatus action, providing examples of the results that the action returns. The JavaScript examples do not show how to create a connection to a data source, but the dataId variable used would be from a call to Data.open. The results are shown in JSON.
Content: Summary
The summary contains information about each synchronization service used for a data synchronization operation.
CS.Data.getSyncStatus({
    dataId,
    content: 
"summary"
});
Sample result:
{
 
"lastPut": {
   
"time": "2026-06-09T15:27:03Z",
   
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
   
"deviceName": "https://example.org/csweb/api/",
   
"username": "jackw",
   
"universe": "",
   
"direction": "put",
   
"partial": false
  },
 
"lastGet": {
   
"time": "2026-06-03T18:34:25Z",
   
"deviceId": "Dropbox",
   
"deviceName": "Dropbox",
   
"username": "jackw@example.org",
   
"universe": "",
   
"direction": "get",
   
"partial": false
  }
}
Filtering on a device shows only information for a particular synchronization service, and also provides information about the number of cases that are pending synchronization. This number means that, if you put data to this service, roughly this number of cases would be transferred.
CS.Data.getSyncStatus({
    dataId,
    content: 
"summary"
    deviceName: 
"https://example.org/csweb/api/"
});
Sample result:
{
 
"lastPut": {
   
"time": "2026-06-09T15:27:03Z",
   
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
   
"deviceName": "https://example.org/csweb/api/",
   
"username": "jackw",
   
"universe": "",
   
"direction": "put",
   
"partial": false
  },
 
"casesPendingSync": 3
}
Content: Synchronization History
The synchronization history is returned ordered from newest to oldest.
CS.Data.getSyncStatus({
    dataId,
    content: 
"syncHistory"
});
Sample result:
{
 
"syncHistory": [
    {
     
"time": "2026-06-09T15:27:03Z",
     
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
     
"deviceName": "https://example.org/csweb/api/",
     
"username": "jackw",
     
"universe": "",
     
"direction": "put",
     
"partial": false
    },
    {
     
"time": "2026-06-08T19:38:18Z",
     
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
     
"deviceName": "https://example.org/csweb/api/",
     
"username": "jackw",
     
"universe": "",
     
"direction": "put",
     
"partial": false
    },
    {
     
"time": "2026-06-03T18:34:25Z",
     
"deviceId": "Dropbox",
     
"deviceName": "Dropbox",
     
"username": "jackw@example.org",
     
"universe": "",
     
"direction": "get",
     
"partial": false
    }
  ],
 
"lastGet": {
   
"time": "2026-06-03T18:34:25Z",
   
"deviceId": "Dropbox",
   
"deviceName": "Dropbox",
   
"username": "jackw@example.org",
   
"universe": "",
   
"direction": "get",
   
"partial": false
  },
 
"lastPut": {
   
"time": "2026-06-09T15:27:03Z",
   
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
   
"deviceName": "https://example.org/csweb/api/",
   
"username": "jackw",
   
"universe": "",
   
"direction": "put",
   
"partial": false
  }
}
Content: Synchronization Services
Each synchronization service may have multiple device names. For example, if a CSWeb server's URL changes, the device ID will be constant but the names will reflect both the old and new URLs.
CS.Data.getSyncStatus({
    dataId,
    content: 
"syncServices"
});
Sample result:
[
  {
   
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
   
"deviceNames": [
     
"https://example.org/csweb/api/",
     
"http://localhost/csweb81/api/"
    ],
   
"firstSyncTime": "2026-05-05T08:27:03Z",
   
"lastSyncTime": "2026-06-09T15:27:03Z"
  },
  {
   
"deviceId": "Dropbox",
   
"deviceNames": [
     
"Dropbox"
    ],
   
"firstSyncTime": "2026-06-03T18:34:25Z",
   
"lastSyncTime": "2026-06-03T18:34:25Z"
  }
]
Content: Cases Pending Synchronization
The cases pending synchronization are cases that have not been put from the data source to a synchronization service.
CS.Data.getSyncStatus({
    dataId,
    content: 
"casesPendingSync",
    deviceName: 
"https://example.org/csweb/api/"
});
Sample result:
[
  {
   
"key": "4480489263555",
   
"position": 609,
   
"uuid": "38ed23c6-1967-465a-8011-00287bc9792b"
  },
  {
   
"key": "4480489263333",
   
"position": 3,
   
"uuid": "48e6b01e-734b-4cdb-b30d-fbcd2ea104e3"
  },
  {
   
"key": "4480489263666",
   
"position": 1249,
   
"uuid": "49720a7c-945c-49e5-b888-12dfde1810ff"
  }
]
Content: Case Status
The case status reflects information about the current version of the case. A case may have been synchronized and then later modified, but if the modified case was not synchronized, the synchronization history array will be empty.
CS.Data.getSyncStatus({
    dataId,
    content: 
"caseStatus",
    deviceName: 
"https://example.org/csweb/api/",
    key: 
"4480489263666"
});
Sample result for a case pending synchronization:
{
 
"key": "4480489263666",
 
"position": 1249,
 
"uuid": "49720a7c-945c-49e5-b888-12dfde1810ff",
 
"syncHistory": []
}
Sample result for a case that has been synchronized:
{
 
"key": "4480586623555",
 
"position": 205,
 
"uuid": "73354b1b-f7c0-48f2-8943-538e77a61e7b",
 
"syncHistory": [
    {
     
"time": "2026-06-09T15:27:03Z",
     
"deviceId": "588850ce-330b-4afd-8282-7603e955a7a3",
     
"deviceName": "https://example.org/csweb/api/",
     
"username": "jackw",
     
"universe": "",
     
"direction": "put",
     
"partial": false
    }
  ]
}
See also: Data.getSyncStatus Action