I've gotten a number of questions about ways to create a backup process for SmartSuite data, with many requests to archive data in Google Drive. I’ve put together an approach that uses Make.com to make requests to the SmartSuite API, retrieve data in CSV format, and subsequently create CSV files in Google Drive.
Note: I wrote a community post about this a number of months ago - this article is updated to reflect feedback and to avoid issues with the API requests that were reported by people trying to implement their own backup solution. Notably, the way that you retrieve tables (formerly “Apps”) by Solution has changed - please use this approach in future implementations.
Step 1. Get Tables by Solution
We can get a list of tables in a solution by using the Make an API Call action type for SmartSuite in Make.com. Search for SmartSuite, then select the Make an API call action type.
Configuration of the Make an API Call action:
Select an existing connection or create a new connection to SmartSuite
Specify the URL. Note that you should start with /v1/ as the base URL is prepended by the connector. Replace the example Solution ID with the ID of the solution you want to back up.
Leave the default Content-Type header. Authentication headers are added automatically by the connector.
Select the GET method
Save the configuration
Once saved, right click (command-click on Mac) on the connector and select Run this module only. That will do two things - make sure you have the module configured correctly, and also pull back a JSON response that we’ll use in the next configuration step.
Step 2. Add an Iterator
Now that we have our list of tables, we’re going to add a Make.com interator module to run subsequent steps for each table we retrieved. Click on Tools in the Make.com lower toolbar, and connect the iterator to the Make an API Call module.
Configuring the Iterator:
The iterator takes a single input in its Array property. Click the map option, click into the input box and select the Body[] array from step 1.
Save the configuration by clicking Ok.
Step 3. Create JSON
The most complex part of this flow is constructing the JSON that we’ll use in the request for CSV output from SmartSuite. The easiest way to do this is with Make.com’s JSON module. Search for JSON, select the JSON module, and then click on the Create JSON transformer.
Configuring the Create JSON transformer:
Click Add next to the data structure selector.
Click Generate
Paste the following JSON into the dialog that is presented:
{
"visible_fields": [
"title"
]
}
Accept the definition it generates (providing it a name) and save.
Once the data structure is defined, you will have an input labeled Visible Fields in the JSON configuration interface. You will want to select Map and then construct a statement in the input:
Here is a cut-and-paste starting point for you to construct this - just paste in the code below. You will likely have to re-select the “structure” reference, which should be the element called structure from the iterator step.
{{remove(map(3.structure; "slug"); "followed_by"; "comments_count"; "autonumber")}}
This is doing the following:
Getting the values of the “slug” property contained in the structure[] array
These values are inserted into the array called “visible_fields” which is the input for the call that will retrieve the CSV data
The outer remove function drops certain values that you do not need in the exported data, in this example including the followed_by, comments_count and autonumber values. Note: You cannot return system type fields (id, application_id and other non-field data) in the CSV export. Doing so will cause the request to fail.
Step 4. Retrieving CSV Data from the API
The next step is to actually go export the data from SmartSuite in CSV fashion. Similar to step 1, we’re going to use SmartSuite’s Make an API Call action to do this. Click to add a module after the JSON step, select SmartSuite, then click on Make an API Call to get started.
Configuring the API Call:
Select the same connection to SmartSuite as before
The URL for this call is /v1/applications/{id}/records/generate_csv/
The {id} value should be replaced with the id property from the iterator module
Leave the default headers
Select the POST method
Set body to the output of the JSON module
Save the module by clicking OK
Step 5. Adding an Array Aggregator
In order to maintain the structure of the exported CSV output we’re going to use Make.com’s Array Aggregator module to pull the results from the API response and add them to an array that can be copied into a CSV file in Google Drive. Just click on Tools, select Array Aggregator and link it to the last Make an API Call.
Configuring the Array Aggregator:
Select the prior Make an API Call module as the source module
Leave Target structure type as “Custom”
Select Body in Aggregated fields under the SmartSuite - Make an API call heading
Click OK to save
Step 6. Save to Google Drive
The final step is to save the retrieved data to files in Google Drive. This flow will create a file for each table that has been retrieved. Add a module following the Array Aggregator, search for Google Drive and click the Create a File action.
Configuring the Google Drive action:
Select or add a new connection to Google Drive
Pick Select from the list for Folder ID
Select your drive in Drive Location
Select folder in Folder Location
File - select Map and specify:
File Name - desired file name, incorporating the name value from the iterator
Data - map the Array Aggregator step’s Array[]: Body value
Click OK to save
Make sure you save your scenario. You can then test it by clicking Run Once. You should see the step “thought bubbles” populate with the number of successful iterations: