A variable stands in for a piece of data that changes according to context. For example, if you wanted to greet each user that joins your course by name, you could place the variable that refers to the user's name into the text of your step, and the user will see their name wherever you see the variable in edit mode.

Variables for replacement strings

Add a replacement string to your text inside steps to greet each learner by name or sub in other specific data. 

There are user, step, and global variables available to use within content in any step. Add a string in edit mode, and then use preview mode to see how the string renders with real data. 

For example:

Hello {{ user.first_name }}, you are looking at "{{ step.name }}."

When viewed by Fred inside a step titled "Introduction," will read: 

Hello Fred, you are looking at "Introduction." 

Variables for passing parameters

These same variables can be used within a Typeform embed code to pass parameters to Typeform visible or hidden fields. For example:

<div>
  <div style="left: 0; width: 100%; height: 500px; position: relative;">
    <iframe
      src="https://jvnlwn.typeform.com/to/PWJjNj?step={{ step.name }}&email={{ user.email }}&first_name={{ user.first_name }}&last_name={{ user.last_name }}&link={{ window.location.href }}"
      style="border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;" allowfullscreen allow="autoplay; encrypted-media">
    </iframe>
  </div>
</div>

Note that the full step link is included using:

link={{ window.location.href }}

Query parameters should match Typeform hidden field names exactly.

Variables

Here's a master list of currently available, potentially useful scoped variables and their keys:

User

id
username
first_name
last_name
full_name
email
profile
date_joined
date_joined_timestamp
display_name
membership
abb_name

Step

id
item_type
name
description
is_required
is_skipped
assignment_type
step_verb
userpoints_value
starts
due
has_started
time_to_complete
disable_retries
completion
url

Group (Cohort)

id
name
access_starts
access_ends
enrollment_starts
enrollment_ends
description
visibility
step_counts
url
invite_urls
grade_report_url

Resource (Course)

id
name
description
short_description
categories
image
cover_image
thumb
thumb_2x
icon
background_image
authors
created
url
resource_type_display
sum_registration_count

School (Pathwright Account)

name
url
subdomain
short_description
invite_url_student
invite_url_editor
invite_url_admin
Did this answer your question?