Skip to main content

How to use customer answers in Lantern quizzes

Wendy avatar
Written by Wendy
Updated this week

Lantern lets you reuse answers that customers type into your quiz, like their name, answers, or preferences on other pages in the quiz. This guide shows you how to capture this information and use it in your quiz copy.

How to capture and reuse customers’ answers

To capture any information that customers type in, or any answer they select in the quiz, you can use the Property ID functionality in Lantern to store it and reuse it later in the quiz. For any question, open the General settings in the right-hand side panel and add a Property ID. For example, on a question where you ask "What is your name?", you might set the Property ID to first_name. Lantern saves whatever the customer enters under that Property ID and, from the next question onwards, you can start using that value in your sentences.

Image showing the Lantern quiz editor with the General settings dropdown open in the right-hand panel, and the Property ID field set to first_name.

For example, in the next follow up question, you may want to use their name to address them. To do this, you need to use the Property ID in a specific syntax.

Once a Property ID is set, you can reuse that answer anywhere else in the quiz by wrapping the Property ID in double curly braces. For example, if your Property ID is: first_name

You can reference it like this: Hi {{ first_name }}, what pet do you have?

Image showing a follow up question using the Property ID syntax in double curly braces to reuse the quiz taker’s first name in the question text.

We can also refer back to this property on question pages, transition screens, the results page as well as the email capture page:

Image showing how to reuse a customer's input value, such as their name, in the content of the Optin Page as an example by using a property ID placeholder like {{first_name}}.

How to manipulate the value stored in a Property ID

To further refine the user experience, we've added a range of text manipulation functions:

  1. Capitalize - Turns the first letter of a word into uppercase.

    • Input: james

    • Output: Hi {{ first_name | capitalize }}, nice to meet you!

    • Result: Hi James, nice to meet you!

  2. Lowercase - Turns all letters into lowercase.

    • Input: JaMeS

    • Output: Hi {{ first_name | lowercase }}, how's your day?

    • Result: Hi james, how's your day?

  3. Uppercase - Transforms all letters into uppercase.

    • Input: JaMeS

    • Output: Hi {{ first_name | uppercase }}, shoutout to you!

    • Result: Hi JAMES, shoutout to you!

  4. Trim Functions - Remove unwanted spaces:

    • Trim: Strips spaces from both start and end.

      • Input: "[space]James[space]"

      • Result: {{ first_name | trim }} becomes “James” with no spaces

    • TrimEnd: Removes spaces only from the end.

      • Input: "James[space]"

      • Result: {{ first_name | trimEnd }} becomes “James” with no spaces

    • TrimStart: Eradicates spaces just from the start.

      • Input: "[space]James"

      • Result: {{ first_name | trimStart }} becomes “James” with no spaces

  5. Default - As covered, it provides a default value. The syntax is:

    {{ property_name | default: "Your Default Value" }}

    In many quizzes, certain information, like a first name, is optional. In those cases, you can set a default value to display instead.

    For example:

    Your cat, {{ cat_name | default: "the cute fearless feline" }}, deserves the best food!

    Image showing a side by side view of the quiz editor and the live preview demonstrating the default filter, where the cat_name Property ID falls back to the default text when the name is left blank.

    If the quiz taker leaves the cat’s name blank, Lantern will use your default text instead, so the live preview shows “Your cat, the cute fearless feline, deserves the best food!”

  6. Replace: This function allows you to replace specific strings or characters within your captured data. For instance, if you want to replace the input "a" with the input "b", you'd use it as shown below:

    {{ input_data | replace: "apple", "banana" }}

    The replace filter is useful when you want to reuse an answer but adjust one specific value so it reads better in a sentence.

    For example, imagine a question like “What is your pet’s favorite type of food?” with answers such as “Chicken”, “Fish”, and “Anything is fine”, stored under the Property ID favorite_food .

    Later in the quiz, you might want to reuse this answer in a sentence like:

    We noted your pet’s favorite food is {{ favorite_food }}, and used it to choose the best recommendations.

    This works nicely for “Chicken” or “Fish”, but “Anything is fine” may feel a bit awkward in that sentence. You can use replace to swap that one specific answer with friendlier wording:

    We noted your pet’s favorite food, {{ favorite_food | replace: "Anything is fine", "pretty much anything" }}, and used it to choose the best recommendations!.

    Image showing the Lantern quiz editor with a question that stores answers under the Property ID favorite_food, followed by a Transition Screen where the replace filter is used to replace “Anything is fine” with “pretty much anything” in the text.

    With this setup, “Chicken” and “Fish” will display as they are. If the customer chooses “Anything is fine”, the sentence will display “pretty much anything”, which reads more naturally.

Chaining Functions

To take your customization up a notch, you can chain these functions using standard liquid syntax. Here’s how:

Hi {{ first_name | trim | capitalize | default: "friend" }}, how are you?

By applying this, if someone had entered " james ", they would be addressed as "Hi James, how are you?". If they hadn't entered a name at all, it would display "Hi friend, how are you?"

Reusing the First Name from the Email Capture Page

If you prefer to capture the customer’s first name on the email (opt-in) page instead of using a separate input question, you can reuse that name elsewhere in the quiz using the special variable {{ SPECIALNAME }}.

Image showing the Opt-in Page settings with the first name field enabled, indicating that Lantern stores the opt-in first name using the built in SPECIALNAME variable.

On the Optin page, the first name field does not use a Property ID. This field behaves the same in every quiz and Lantern automatically stores the value under {{ SPECIALNAME }} for all quizzes.

Once the first name field is shown on the opt-in page and the quiz taker fills it in:

  • You can use {{ SPECIALNAME }} in text on:

    • Question pages

    • Transition screens

    • The results page

For example:

Hi {{ SPECIALNAME }}, we've registered your answers and are computing your results...

Image showing a transition screen in the quiz editor and the live preview where the text reuses the SPECIALNAME variable to address the quiz taker by first name.

Important: If the first name field on the opt-in page is optional and the quiz taker skips it, using {{ SPECIALNAME }} on its own will result in the word undefined being displayed. To avoid this, combine it with a default value, for example {{ SPECIALNAME | default: "Friend" }}.

Reusing answers from previous questions

You can also reuse answers from previous questions, not just from input fields, since Property IDs are a general functionality in Lantern on any question page, transition screen, results page, and under Content Blocks or Dynamic Content Blocks. As long as a question has a set Property ID, you can pull that answer anywhere in the quiz using the {{ property_id }} syntax.

For example, if you have a question like “What pet do you have?” we can set a Property ID of pet_type to store the answer.

Image showing a quiz question asking what pet the customer has, with the Property ID field set to pet_type in the Question Properties panel.

Once customers answer this question, you can reuse their choice later in the quiz by integrating your Property ID in future sentences to replace the answer under double brackets. For example: You said {{ pet_type }}

If the question allows multiple answers, reusing the Property ID will output all selected answers, separated by commas. For example, if a different question lets customers pick "Daily walks" and "Weekend hikes", reusing that Property ID might output: You said your dog loves to take daily walks,weekend hikes. What is your furry friend's age?

Image showing a multiple choice question where two answers are selected and the next page reuses the same Property ID, displaying the selected values together separated by commas.

Why use assigned values

Sometimes the exact answer label does not read well when you reuse it in a sentence. Assigned values solve this by letting you keep the full answer labels customer-friendly while providing a shorter, cleaner version behind the scenes that is easier to reuse in copy.

An assigned value is a hidden value you set for any answer option in the quiz editor. It is only visible in the quiz editor, and its purpose is to be used with Property IDs instead of the written answer text, so you can optimize the text in the assigned value for better use when it is called out in other sentences, rather than adjusting your answers to fit being reused instead of being written in the best format for the question itself.

In the image, we can see an example where, in purple, we’ve introduced the assigned values for the answers we have, which are in a quiz-taker-friendly format, not as friendly for reuse in sentences.

Image showing a question titled “What pet do you have?” with three answer options (I have a dog, I have a cat, I have both). The Question Properties panel on the right shows the Property ID set to pet_type, and Assigned values are set for the “I have a dog” and “I have a cat” options, while the “I have both” option has no Assigned value.

The Property ID is still pet_type, but when you reuse it, Lantern will output the Assigned value instead of the full label:
Since you have {{ pet_type }}, here is what we recommend next.
This way, the sentence reads naturally no matter which option the customer selects.

Assigned values are especially helpful when you want to keep your logic and messaging clean, for example in Skip/Show conditions, integrations, or when you need natural wording in sentences on transition screens, Dynamic Content Blocks, or the Results Page. If an answer does not have an Assigned value, Lantern will reuse the visible answer text instead.

If a question allows multiple answers, and some answers have Assigned values while others do not, Lantern will reuse whatever is available for each selected answer. Answers with an Assigned value will output that custom value. Answers without an Assigned value will output the visible answer text. All selected values are combined into a single string, separated by commas.

Image showing a multiple choice question where some selected answers have Assigned values and others do not, and a follow up page reuses the Property ID to display a combined output that includes both the Assigned values and the visible answer text separated by commas.

If the question is optional and the customer skips it, reusing that Property ID will output nothing.

To keep things readable, choose Assigned values that are short, lowercase, and easy to reuse in sentences. For example, use simple, self explanatory words that will look natural when customers see them wherever you reference the Property ID.

For more examples of using previous answers to personalize the results page, see Customize the Results Page using customer answers.

With these dynamic capabilities at your fingertips, your quizzes can now be more engaging, personalized, and user-friendly. Make each interaction count by making it about your user, tailoring it to their inputs in real-time. Happy quizzing!

Did this answer your question?