Forum Discussion
SasikumarMuruga
4 months agoCommunity Member
Get the Learner Name from Saba Cloud
Hi, We are using Saba Cloud and I am trying to get the Student Name from SCORM package using SL360 but I am not able to get that information. Here is the code I am using it
var player = GetPlayer(...
JoeFrancis
3 months agoCommunity Member
I am using this Javascript in Cornerstone SBX (aka Saba) to retrieve the learner's UID and name, which I then parse into first name/last name:
var player = GetPlayer();
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 lmsStudent_ID = lmsAPI.GetStudentID();
player.SetVar("lmsStudent_ID", lmsStudent_ID);
var lmsStudent_Name = lmsAPI.GetStudentName();
var nameArray = lmsStudent_Name.split(", ")
var niceName = nameArray[1] +" "+nameArray[0];
player.SetVar("lmsStudent_Name", niceName);
var txtFirstName = nameArray[1];
var txtLastName = nameArray[0];
player.SetVar("txtFirstName",txtFirstName);
player.SetVar("txtLastName",txtLastName);
With the following variables declared in Storyline:
- lmsStudent_ID
- txtFirstName
- txtLastName
If you want to declare a variable in Storyline named txtStudentName and populate it with what lmsStudentName retrieves, that may help with troubleshooting.