• <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
      • Services
        • Overview
        • Synchronization Connection String
        • CSWeb
        • Bluetooth
        • Dropbox
        • FTP
        • Local Files
        • Syncable Name
      • Messages
    • CSPro Statements and Functions
    • Text Templates
    • Templated Reporting System
    • HTML, Markdown, and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataManager>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Dropbox Synchronization Service

Overview
Dropbox is a free, cloud-based synchronization service ideal for small- to medium-sized survey operations. Dropbox is a file hosting service run by an American company. Using Dropbox requires no server setup or maintenance and avoids the complexity of configuring the preeminent CSPro synchronization option, CSWeb. However, data stored on Dropbox is managed by an external company, and some organizations restrict storing data with third parties.
To use Dropbox, you must create or use an existing account. Using Dropbox does not require the client software to be installed on your machine, as access to Dropbox will be made using requests over the Internet.
If you do have the client software installed on Windows, an optimization allows you to connect to your Dropbox files using the Local Files synchronization service. When doing this, the Dropbox client manages data transfers. This option is primarily useful when downloading large amounts of data, which may take a long time through the online Dropbox connection.
Dropbox Connection
A connection to Dropbox occurs as a result of a syncconnect function call, or as part of a CSPro operation such as a Simple Synchronization or an application deployment.
The resource of a Dropbox connection string is simply the text "Dropbox".
Dropbox will authenticate the connection and confirm that you want to allow CSPro to access data stored on Dropbox. At this authentication stage, it is possible to specify which Dropbox account you want to use. However, if you want to specify this directly, you can use the connection string property "email".
These are options that can be specified in the connection string. Note that values must be properly encoded based on the way that the connection string is defined (as a string, as a JSON object, or as a CSPro URI).
Property Name and ValuesDescription
 
"email"The email address associated with the Dropbox account. The connection fails if the user authenticates using a different email address.
The following are examples of how to create connections to Dropbox:
// Dropbox's authentication screen allows the user to specify what account they want to use
syncconnect("Dropbox");

// an error occurs if the user does not authenticate with jackw@example.org
syncconnect(maketext(
   
"Dropbox|email=%s",
   
encode(PercentEncoding, "jackw@example.org")
));
Credential Storage
When connecting to Dropbox, an access token is generated that provides access to Dropbox data for some amount of time without needing to always authenticate the access. This token is stored in your operating system's secure storage. You can use the Manage Credentials dialog to manually clear this credential.
Local Dropbox Connection
On Windows, if you have the client software installed on your machine and are logged into Dropbox using the same account used for CSPro synchronization, you can use the Local Files synchronization service to speed up operations. Rather than connecting over the Internet to Dropbox, CSPro will directly access the Dropbox contents on the local machine. For example, if the Dropbox directory is mapped to C:\surveys\dropbox, you can connect directly using:
syncconnect("file:///C:/surveys/dropbox");
The Dropbox home directory should contain a folder named CSPro, which contains the files used for synchronization operations.
Alternatively, CSPro can try to automatically determine where the Dropbox directory is located when the following options are specified in the connection string. The default behavior is marked with ⁺⁺⁺.
Property Name and ValuesDescription
 
"useLocal"Determines whether CSPro tries to access Dropbox using the client software.
false ⁺⁺⁺
Do not use the client software, only access Dropbox using a remote connection.
true
Only use the client software. An error occurs if it does not exist.
"try"
Try to use the client software. If not possible, use the remote connection.
 
"account"The type of account to use.
"personal"
Use a personal Dropbox account.
"business"
The a business Dropbox account.
When "useLocal" is true or "try", CSPro will try to identify the location of the Dropbox directory. If there are multiple Dropbox accounts on the machine, the "account" property allows you to specify which type of account to use. If not specified, the personal account is used when both personal and business accounts exist. If "account" is defined but "useLocal" is not, "useLocal" defaults to "try".
The "email" property is ignored when using the client software.
The following are examples of how to create local connections to Dropbox:
// access Dropbox using the client software when possible
syncconnect("Dropbox|useLocal=try");

// access the business account on Dropbox only using the client software
syncconnect("Dropbox|useLocal=true&account=business");
Synchronization Data Storage
Once CSPro connects to a file-based synchronization service, it looks for or creates a directory named CSPro in the root directory, using it for the results of synchronization operations. CSPro uses the following directories:
DirectoryDescription
/Files accessed using syncfile are evaluated from the root directory, not the CSPro directory.
 
/CSPro/apps/Applications deployed and used in operations such as syncapp or while updating applications.
 
/CSPro/DataSync/Case data uploaded using syncdata, and the dictionary describing it, are stored in subdirectories named using the dictionary's syncable name. For example: /CSPro/DataSync/LFS2026_DICT/data/ and /CSPro/DataSync/LFS2026_DICT/dict/.
 
/CSPro/messages/Messages sent using syncmessage or Sync.sendMessage.
 
/CSPro/paradata/Paradata logs uploaded using syncparadata or Sync.syncParadata.
See also: Synchronization Services, Local Files Synchronization Service