Unable to pull student names from Workday Learning LMS

Dec 08, 2020

Hi all, 

I've read through all the lms name pulling discussions but I still have no luck pulling the student name correctly in Workday Learning. I was wondering if anyone is using Workday Learning LMS and was able to utilize the name pulling codes successfully? I think I got the Workday Learning to talk back (sort of) because my first and last name would display as "Learner Workday" and the codes are definitely working as intended (pull my real name) when I tested in SCORM Cloud. 

The codes I am using are as following. Could anyone provide any more insights on Workday Learning lms? Thank you!  

function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);
}

var lmsAPI = findLMSAPI(this);
var name = lmsAPI.SCORM2004_GetStudentName();

var nameArray = name.split(", ");
var firstName = nameArray[1];
var lastName = nameArray[0];
var fullName = firstName + ' ' + lastName;

var player = GetPlayer();
player.SetVar('first_name', firstName);
player.SetVar('last_name', lastName);
player.SetVar('full_name', fullName);
5 Replies
Cat Spence

Here's the information I shared with our eLearning developers previously along with the above configuration from Workday. This is 3 years old though!

"What variable do I need to setup to pass learner name to a SCORM package?" 
 
A JavaScript that they used in Storyline;

//See if we're connected to an LMS 

function findLMSAPI(win) { 

  if (win.hasOwnProperty('GetStudentID')) { 

    return win; 

  } else if (win.parent == win) { 

    return null; 

  } else { 

    return findLMSAPI(win.parent); 

 }  

 

//Read data from the LMS 

var studentName = lmsAPI.GetStudentName(); //returns Last, First 

var studentID = lmsAPI.GetStudentID(); 

 

//Get the Storyline player 

var player = GetPlayer(); 

 

//Set Storyline variables 

player.SetVar('student_name',studentName); 

player.SetVar('student_id',studentID); 

 

//Separate first name and last name 

var splitNames = studentName.split(','); 

var firstName = splitNames[1]; 

var lastName = splitNames[0]; 

 

//Set more Storyline variables 

player.SetVar('first_name', firstName); 

player.SetVar('last_name', lastName);