Passing Information In and Out of a Lighthouse Studio Survey

Last Updated: 12 Dec 2022Hits: 2753
How do I pass information in and out of a Lighthouse Studio survey?

Note: If you are using Lighthouse Studio 9.13 or earlier, please see this article.

The typical use case for passing information in and out of a Lighthouse Studio survey is to capture and return a unique identifier for each survey respondent. This might be an ID provided by a panel company or your own ID to match survey data to other data. In both cases the setup is the same.

Part 1: Survey 

First, click on the Access icon across the top of Lighthouse Studio (the key icon) 

Key Icon

Next, click on the + button to add a new variable to the survey. The first variable added will default to the Unique ID type with a default name of MyIdentifier. Unique ID types are special in that they will only allow a value to be used once to complete a survey. They will also allow a respondent to restart where they left off if they leave and come back to the survey with the same value. 

Plus Button

Note: Variable names cannot have any special characters and spaces. If the original source of the variable name has special characters, we can add them back in later on (see Part 2 for an example). 

If you want to have values for the Unique ID that can be used more than once (such as for testing purposes), you can click on the Define IDs button next to the + button and add them there along with how many times each can be used. Values that are allowed to be used more than once will not restart the respondent to where they were in the survey. 

You can add additional variables beyond a Unique ID by clicking the + button. Linking Variables give you a place to capture additional variables when the respondent begins a survey. For example, you might have a Unique ID called PID (Panel ID) plus a Link Variable called Source you can use to track which panel company the respondent came from (e.g. Source=1 and Source=2). The Source variable can then be used later on to redirect respondents to the appropriate Terminate points at the end of the survey. 

Part 2: Redirects 

Your panel provider or other survey platform will provide you with a return link to use at the end of the Lighthouse Studio survey and where to insert the value of the Unique ID when redirecting the respondent back.  

First, click the Add button and add a Terminate point to your survey. Note that Terminate points must be by themselves, so make sure to add a Page Break after the last question in your survey before adding Terminate points. 

The most common approach would be to avoid any text on this page and set the page to Redirect immediately and enter the URL of the destination. 

Terminate Settings

Let’s assume you had a redirect for completed respondents like this: 

The rst variable here is static and is used to indicate a completed respondent, so we use that as-is.  

The PID variable would be named differently depending on the panel company or survey platform you are working with. To reference it correctly, we would use the name defined in Part 1 (default of MyIdentifier) to return the value captured through the link when the respondent began the survey. Unique ID and Linking Variables act like any other survey variable (question answer, quota assignment, MaxDiff score, etc.), and we can reference it anywhere in the survey by placing inside of Sawtooth Script tags like this: [%PID%] or [%MyIdentifier%]. 

Assuming we changed the default from MyIdentifier to PID,  we would modify what the panel company provided like this:[%PID%] 

If we captured a value of 12345 for PID using the link we set up in Part 1, then the outgoing link would evaluate to 

Note if your original variable name contains special characters, you can enter them here in the outgoing link just fine. For example, if my variable was called Panel_ID I could set it up as PanelID (or really anything, we could call it P) because all I need to do is reference it’s value in the outgoing link:[%PanelID] (or [%P%]) 

If you have additional redirect links, such as a terminate and over-quota link, you can add those after the complete Terminate point, again separated by page breaks: 

Question List

This way complete respondent follow the natural progression of the survey and the only way to hit the Disqualified and Over-Quota redirects is by triggering skip logic. 

Part 3: Operations on Unique IDs 

Sometimes a panel company will require you to perform some operation on a variable. For example, they will pass in VariableX and VariableY, both of which are Unique IDs, and require you to return VariableX as-is but take VariableY, perform some mathematical operations, and return the result of those operations. 

We can perform all basic mathematical operations inside Sawtooth Scripting tags, we just need to add an extra step with the StringToNumber() function. 

Expanding on the example above, let’s assume the redirect URL was 

and the instructions were to take VariableY and multiply by 12 and subtract 500. The Terminate redirect would look like this:[%VariableX%]&VariableY=[%(StringToNumber(VariableY)*12)-500%]