A utility for exporting a survey from Qualtrics and importing the resulting CSV into Google Sheets (all in one command). It can also be used for either of those two tasks separately: only automating export from Qualtrics, or only uploading (any arbitrary) CSV to Sheets.
If you want to work with your Qualtrics data in Google Sheets, you typically have to achieve this manually by:
- Exporting the data from Qualtrics
- Downloading the exported file
- Unzipping the CSV
- Uploading the CSV to Google Drive
- Converting the CSV to a Google Sheets spreadsheet
This utility exists to automate these steps. Specifically, you can:
- Download the Qualtrics CSV
- Upload it (or any other CSV!) to Sheets
- Do it all in one go
To run this program, you need Java 11 or later on your system. (It should be possible to recompile the program for older versions of Java as well.)
Download it from releases or compile it yourself by running ./gradlew shadowJar
.
(The compiled program will be at qualtrics2sheets/build/libs/qualtrics2sheets-all.jar
.)
If you downloaded or compiled the JAR file, you can execute it as java -jar qualtrics2sheets.jar
, followed by the command-line arguments (documented below).
The other file in the releases is the same JAR with a launcher script included.
(It will only work on macOS or Linux.)
You can make it executable (chmod u+x qualtrics2sheets
) and even put it somewhere on your PATH.
Before you run the program, you'll need to get the proper credentials for the respective APIs. You'll only have to perform these steps once.
You'll need your Qualtrics API token, which you can obtain by following this Qualtrics documentation.
Once you have it, you'll pass it to qualtrics2sheets
using the --token
flag.
You'll need a Google Cloud credentials file. (When this was last updated) the steps to do this are:
- Create a new project in Google Cloud Console
- Enable the Google Sheets API for this project
- Configure the consent screen for an Internal app
- Create an OAuth client ID credential
- Download the JSON file with the newly-created credential
- Once you have the credentials file, save it somewhere on disk
- Pass its location to
qualtrics2sheets
using the--credentials
flag.
The first time you run qualtrics2sheets
, it will need to use those credentials to obtain an authentication token (which is what's actually used to interact with the API).
To do this, it will open a new browser window, where you'll be asked to authorize the application you created in the Cloud Console with access to Sheets.
The resulting authentication token will be stored in the tokens
directory in your current working directory. (You can change this location using the --tokens-directory
flag.)
Warning: when you run the program, it will overwrite the contents of the target spreadsheet. Make sure you're not losing any data.
Here is a sample of how to run the program.
(Remember that if you're using the JAR file, you'd instead run java -jar qualtrics2sheets.jar run ...
)
qualtrics2sheets run \
--datacenter ca1 \
--token $QUALTRICS_TOKEN \
--credentials /path/to/credentials.json \
--spreadsheet 1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
--survey SV_xxxxxxxxxxxxxxx
--datacenter
is your account's Qualtrics datacenter, see the documentation here--spreadsheet
is the ID of your spreadsheet (you can get it from its URL)
For example, if the spreadsheet's URL ishttps://docs.google.com/spreadsheets/d/12345...90/edit#gid=111
, its ID is12345...90
--survey
is the ID of your Qualtrics survey (you can also get it from its URL)
For example, if the survey's URL ishttps://www.qualtrics.com/surveys/SV_1234567/
, its ID isSV_1234567
You can also run the pipeline steps separately:
qualtrics2sheets download_qualtrics
qualtrics2sheets upload_csv
For the latter, the program will upload any CSV to Google Sheets: it doesn't have to be a Qualtrics export.
If the targeted spreadsheet has multiple sheets (tabs), the contents of the CSV will be written to the first one.
Reminder: the content of the sheet will be overwritten by the CSV without any warnings.