Understanding Sync Tables
In some cases, you may want to sync real-time data to a connected dataset. For example, you can sync to live weather source from a public URL data file or sync to a shared spreadsheet of data that is maintained on your Google Drive or Dropbox.
You can create synced tables through CARTO Builder, or through the Import API.
During the connect dataset process, select the frequency to sync the data every hour, day, week, or month.
Additionally, analysis can be applied to layers that contain a synced dataset. Every time the real-time data is refreshed, the analysis is re-run!
Syncing to an External Datasource
Before connecting to an external datasource, you must select the external service from the Connect Dataset options. This is a one-time setup. After your external connectors are enabled and connected, the connect dataset options display a list of your Google Drive, Dropbox or Box files.
Syncing to an external datasource is not available for free account plans.
For this example, suppose you have an Excel file in a Dropbox folder. With CARTO Builder, you can create a map using your data as a connected dataset and sync to the .csv file.
-
Enable the Dropbox connector, available from the Connect Dataset options.
The Connect Dataset options appear when you are adding a new dataset from the Data page, or when you are adding map layers in Builder.
-
Connect the dataset (or add a layer) to the live data.
Only compatible data formats are supported for sync files.
CHEATSHEET: Supported Data Formats
CARTO supports a large number of data types and file formats, including shapefiles, KML, GeoJSON, CARTO files, and more. For details about the type of data that you can import, see Supported Geospatial Data Formats.
It is highly recommended that you compress your files before importing them. CARTO supports .ZIP and .GZ (which includes .TAR.GZ and .TGZ) for compressing and archiving files.
If you are importing a non-supported file type, the import will fail. See Import Errors for a list of known error codes and solutions.
-
To keep your connected dataset in-sync, select the desired frequency of updates to every hour, day, week, or month.
When the data is updated from the external resource, the synced data automatically updates to show the changes in CARTO.
Syncing to a Public URL
Optionally, you can enter a public url data file to sync data to your account. For example, add a map layer connecting to public earthquake data and see how you can set the sync options.
-
Copy the public feed data, provided by provided by the USGS Earthquake Hazards Program.
-
When connecting a dataset, enter the copied url of data. For example,
https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_week.csv
You can change the sync options at anytime by accessing the dataset options.
Changing the Sync Frequency
After connecting a dataset with sync options, you can modify the frequency of sync options from the Data page, or from accessing the original data source directly from a map layer.
- From the Data page:
- Open the synced dataset. The dataset toolbar displays the last time the connected dataset was synced.
- Click VIEW OPTIONS to modify the sync dataset options.
- Click SAVE.
- From a map layer:
- Select the original connected dataset from the map layer. Builder displays the last time the connected dataset was synced.
- Click VIEW OPTIONS to modify the sync dataset options.
- Click SAVE.
If you have a connected dataset from the Data Library, you will not be able to change the sync frequency. You can only disconnect the synced data. This is intentional by design, as datasets from the synced library are synced differently then public data.
Disconnect Synced Data
Synced tables cannot be edited in CARTO Builder, as the data is being pulled from another resource. If you want to edit the dataset, you can disconnect the dataset from the source by altering the sync frequency to Never. Disconnecting synced options means that the dataset is now considered local, and can be edited by adding rows and values.
Once you change the sync frequency to Never, the sync options are removed and you will not be able sync the dataset. If you are interested in syncing to real-time data, you will have to re-import the live data again.