Forum Discussion

CarrieWang-41db's avatar
CarrieWang-41db
Community Member
5 years ago

Unable to pull student names from Workday Learning LMS

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);
  • EdwardValeza's avatar
    EdwardValeza
    Community Member

    Following this post, as I have the same concern. The JS code works, tested in SCORM Cloud, but as Carrie said, the result I'm getting in Workday LMS is "Learner Workday". I'm thinking that the student ID in WD is defined by a different variable. 

  • CatSpence's avatar
    CatSpence
    Community Member

    You also need to opt to Innovation Services to benefit from the new "Learner Name service" to enable the Learner name/ID information to pass across. (Released 20/11/2020)    

  • Hi. I'm currently working on a course that will also be used on Workday and I'm looking for a way to pull the student's name into the course and I'm facing the same issue. Is there any update on this? Any solution? Has anybody successfully imported the name and what variable did they pull? Thank you.

  • CatSpence's avatar
    CatSpence
    Community Member

    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);