Help With JavaScript Please

Apr 04, 2023

Hi All- I'm trying to simply combine the information from multiple variables in Storyline into one variable using JavaScript. I don't have any experience with coding. I can't get this to work. Slide1, Slide2, Slide3, Slide4, Slide5 are all text along with Combined. They are set up in Storyline. Here is the JavaScript:

var player=GetPlayer();
var value01=player.GetVar("slide1");
var value02=player.GetVar("slide2");
var value03=player.GetVar("slide3");
var value04=player.GetVar("slide4");
var value05=player.GetVar("slide5");
var TotalString=value01 + value02 + value03 + Value04 + Value05;
player.SetVar("Combined", TotalString);

When I publish locally and test by launching story.html the Combined field is not updating. Any ideas or suggestions would be awesome. Thank you!

4 Replies