Library Read Database
Reads values from the survey database.
- Zachary Anderson
- Written for Lighthouse Studio 9.3
- Last Updated: 28 February 2017
Reads all previous responses for a given question. Any operations can then be done with this data.
- Line 3 should be set to the name of the question whose responses will be read from the database.
- Line 4 should be set to the data table where this question is stored. This is most likely the name of your survey followed by
- Lines 6-9 must be filled with your database credentials.
If you are using Sawtooth hosting, sign in to hosting.sawtoothsoftware.com and navigate to the survey settings:
$databaseNamelikely looks like
$databaseUserlikely looks like
$databasePassshould be a long string of random characters.
$databaseHostshould be a URL.
- From line 26 on, you can write whatever Perl you wish. You could return the number of times a response appears, or determine if the newest response is a repeat, or anything else.
1on line 35. Before doing this, know that this will make it possible for any respondent to see the answers from previous respondents for this question. If responses to this question need to remain confidential, do not make this change.
You will need to upload your survey to test that this question is behaving correctly.