• <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
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • Logic Namespace
      • Message Namespace
      • Network Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • Sync Namespace
        • Sync Action Invoker Namespace
        • Sync.connect Action
        • Sync.disconnect Action
        • Sync.getConnectionInfo Action
        • Sync.sendMessage Action
        • Sync.syncData Action
        • Sync.syncParadata Action
      • 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>

Sync.getConnectionInfo Action

Format
s = CS.Sync.getConnectionInfo(syncId := ...)
ArgumentDescriptionTypes / Required
syncIdThe resource ID returned by Sync.connect.number
recommended
Description
The Sync.getConnectionInfo action returns information about a connection to a synchronization service. This information includes the server URL and device ID, the name of the user, and other details.
The synchronization service is identified using syncId, a resource ID returned by Sync.connect. While optional, this should generally be specified explicitly. (If there is only one synchronization session active, the resource ID can be calculated implicitly.)
Return Value
The action returns an object containing the properties:
PropertyValue
"syncId"The resource ID that identifies this synchronization service.
"startTime"The time that the connection to the synchronization service was initiated.
"connection"The synchronization connection string, in JSON format, used for this connection. Sensitive properties defined in the connection string, such as a password, are not returned.
"deviceId"The synchronization service's device ID, which is used as part of data synchronization.
"deviceName"The synchronization service's device name, which is also used as part of data synchronization.
"username"The name of the user who logged into the synchronization service. For Dropbox connections, this is the email address associated with the account.
"apiVersion"An API version number optionally provided by the synchronization service.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form or if the synchronization connection ID is not valid.
Example (JavaScript)
const syncId = /* retrieved from a call to CS.Sync.connect */;

const syncInfo = CS.Sync.getConnectionInfo({
    syncId
});

if (syncInfo.username === "admin") {
   
throw new Error("You cannot log in as the administrator!");
}
See also: Sync Action Invoker Namespace, Data.getSyncStatus Action