Personalize with Fills and Computations#

In this lesson you insert an earlier answer into a question’s text, and derive a yearly cost from the monthly cost. At the end you will see the personalized text render live in the preview.

The video below performs every step in this lesson.

Watch the lesson video.

Add a Question with a Fill#

  1. Open the Meridian Internet Access Survey and its Internet use section.

  2. Add a Multiple Choice question above the comments question and name it netsat. Create a code list with Very satisfied, Somewhat satisfied, Neither satisfied nor dissatisfied, Somewhat dissatisfied, and Very dissatisfied.

  3. As its question text, type: How satisfied are you with your {{connection_type}} service?. The double braces mark a fill token.

  4. In the question’s editor, open the Text Replacement tab and add the token: Token connection_type, Description The household's connection type.

  5. Back on the canvas, the token renders as an amber chip: declared, but not yet bound.

Bind the Fill#

  1. Click the input indicator on the netsat card to open the Inputs dialog.

  2. Bind the connection_type input to the conntype answer.

  3. Click Save. The chip turns blue.

Derive the Annual Cost#

  1. Add a Computation below the cost question and open its editor.

  2. Name it ANNUALCOST and label it Derived annual internet cost.

  3. On the Outputs tab, add a field named ANNUALCOST and set its Representation Type to Numeric.

  4. On the Inputs tab, add an input and choose the netcost answer.

  5. On the Expression tab, add a step, assign it to the ANNUALCOST field, and choose the Multiplication function. Set the first value to reference the netcost input, and the second to the number 12.

  6. Save with Ctrl+S.

See It Live#

  1. Open the Household section and switch to Split.

  2. Answer Yes and click Continue.

  3. Choose Fibre as the connection type. The satisfaction question now reads “How satisfied are you with your Fibre service?”.

Split mode with the fill substituted in the preview Split mode with the fill substituted in the preview
  1. Enter a monthly cost and open the Parameters popover in the preview header to watch the derived annual cost.

  2. Switch back to Editor.

The survey now adapts its wording to earlier answers and derives a value no one was asked for.

See also

Next lesson: Translate Your Survey.