ChatGPT makes side projects easy: a case study
An article about Greybox Wrapped published on Linkedin.
23 Apr, 2023 - 01 Min read
To create a feature in a pilot study I was running in December, I took a dive into Qualtrics API and custom web service building. In the process, I discovered a couple of workarounds and little-documented properties of both. The key to integrating them: piped text.
With piped text, you can insert any embedded data and any answer your subject gave into (almost) any Qualtrics context.
If this doesn’t excite you, it should.
Let me rephrase. Piped text references the content of variables you can set. It can do this in conditional validation, display logic and survey flow. (You can’t make it into a GOTO, but that might be a good thing.) The documentation undersells this; this Qualtrics blog article does it a little more justice.
For my purposes, the most important insight goes unmentioned: you can use piped text to pass data to an external web service. That way, you can use data from an in-progress session as input for arbitrarily complex logic implemented in a programming language of your choice.
How does this work? First, you identify the shortcode for an answer or embedded field. Then, you insert it into the URL, like so:
http://your.service.URL/${e://Field/Identifier}/${q://QID1783/ChoiceTextEntryVField>
This will substitute the value of Field
and the answer to question QID1783
in time for the redirect.
Qualtrics can call an external service in two ways.
The external service then passes the results back to Qualtrics.
”Pass results back to Qualtrics” glides over a big issue: Qualtrics documentation does not provide a list of valid return formats. The documentation and the only StackOverflow answer I could find both mention RSS as the only example of an acceptable format. The random number generator everyone uses for MTurk compensation, however, has a much simpler outcome: random=7
. That’s hopeful, but what if you want to pass multiple values back? Docs don’t say.
I decided to test this out on a dummy web service I wrote in Sinatra. It turns out that Qualtrics will take data from JSON, XML, and URI query element. (That’s ?a=b&c=d
- I owe this insight to Andrew Long at the Behavioral Lab.) You can try this out for yourself — just put down https://salty-meadow-86558.herokuapp.com/ as your Web Service in Qualtrics.
My project required more data to the custom Web service than Piped Text could conveniently pass, which meant that I needed to tangle the API. For that, see part two.
An article about Greybox Wrapped published on Linkedin.
23 Apr, 2023 - 01 Min read
Automating an unwieldy genomics processing & analysis pipeline with Snakemake and friends.
02 May, 2022 - 05 Mins read
If you're looking for a skilled data engineer passionate about transforming data into actionable insights or simply want to have a chat.