9 Replies
Matthew Bibby

Okay, follow these steps:

  • Add a text variable to Storyline called Name
  • Go to View > Slide Master and add an Execute JavaScript trigger to the first master slide. It should look like this:

  • Then click on the Script button ... and paste the following code:
function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);

if (!window.nameFromLMS) {
var lmsAPI = findLMSAPI(this);
var name = lmsAPI.GetStudentName();
var nameArray = name.split(', ');
var firstName = nameArray[1];
var lastName = nameArray[0];
var fullName = firstName + ' ' + lastName;
var player = GetPlayer();
player.SetVar("Name", fullName);
window.nameFromLMS = true;
  • When this code runs, it'll grab the learners name from the LMS, reformat it and then store it in the variable we created earlier.
  • You can display the learner's name by adding the following reference to Storyline: %Name%

Here is a demo (via SCORM Cloud, you'll need to enter an email and name to proceed, but dummy values are fine).

Here is the .story file.

And here is the SCORM package which you can upload to your LMS to test that this will work in your environment. 

Hope that helps mate.