This guide will cover how to dynamically display a learner's name on Storyline content.

Note: You won't need any Javascript knowledge, we've written the script for you, but you will need Storyline software.

In your Storyline software...

Add a trigger to "Execute Javascript".

You will need to add a script that will read from the launcher URL to get the learner's name. It will then set a variable to the learner's name. The script we've written is below.

Paste in the below Script:

var actorParam = getQueryVariable('actor');

var player = GetPlayer();
if(player) {
var name = actorParam["name"];
player.SetVar("actorname", name);


function getQueryVariable(variable)
var query =;
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){
return convertToJSON(pair[1]);
return undefined

function convertToJSON(v) {
if(!v) {
return {}
return JSON.parse(decodeURIComponent(v.replace(/\+/g, '%20')));

Add in a variable in Storyline by clicking on the (x) icon:

Create a "text" type variable, and call it "actorname".

Set the default value to whatever you like. We've set it to "learner". Ideally if the script is working properly, you shouldn't see this default value at all.

On the Storyline slide you can display the learner's name by inserting a textbox and pasting in:

The learner’s name is: %actorname%

The %actorname% will be replaced by the learner's name.

A published Tin Can package to demonstrate how it works is attached below:

Storyline Tin Can package

To see how it works you can:

  1. Upload this package into xapiapps using the Storyline launcher
  2. Add to a pathway
  3. Assign the pathway to a learner
  4. Log in / impersonate this learner and start the task

You'll see the following on the Storyline slide.