Display a Learner's Name Using Logic
In this article, we’ll take a look at how you can use variables to manually store a learner’s name and reuse it elsewhere in your Evolve course. We'll cover:
- Creating the variable
- Using a component to save the response
- Using variable responses in components
Things to note
This article currently shows the manual process of pulling a learner's name using Logic. This process differs from the automated process of pulling a learner's name into your Evolve course via an LMS (learning management system).
Create a variable
First, you will need to create the variable that the learner's name will be stored in. Follow the steps below to create the variable:
- In your Evolve course, click Logic
- Click Variables
- Click Add Variable
- Give your variable a title, for example, "learner name."
- Select your variable type. In this case, it will be string.
- Set a default value, for example, "learner." To note, the default value is the text that will be shown until the learner inputs their response.
You’ve now created your variable and it’s ready to be used in a component.
Save the learner response
To store a learner’s response to a variable, you will need to use a component that allows you to save inputs to a variable.
Head over to the page builder and click Add Component. In the Component Filter dropdown, click Variable.
You will then see a list of components that allow you to save responses to variables, find Text Area and add to the course.
Once added to your page click Edit Component. In the component, you will need to set up each tab according to your needs.
First, we’ll focus on setting up the Text Area tab where you will set the display to Text Input. Add a placeholder if you'd like — an example would be your name.
Enable or disable Allow Editing toggle depending on whether you would like your learner to be able to edit their response once saved.
Next, we need to set up the Behaviour tab, in order for the input to be saved to the variable. Enable Save User Answer to Variable?
From the dropdown select the variable you wish to save to the learner name variable. Keep the variable save type as replace.
The component has now been set up to store the learner’s response in the variable.
Use variable reponses in compontents
In this section, we'll take a look at how we reuse the learner’s name elsewhere in the course text using the insert variable function in the text editor. Follow the steps below:
- Go to the component you wish to use the learner’s name in.
- In the text editor, you will see an insert variable icon. Click Insert Variable.
- A pop-up will appear, find the variable you wish to use select it and press done.
- The variable has now been inserted into the text and will display the learner’s response.
- Repeat this wherever you wish to show the learner’s name.
Did this article help?
Let us know by leaving a star rating or review at the top of this article.