I am retrieving the url using javascript and then putting that url in a storyline variable, however, I only need a small bit of the url and want to pull certain information from it.
To split down that URL in JS, you'd want to figure out the rules to use in javascript. In this case, if you wanted to push the middle bit of a URL into a SL variable, you could use:
This would push the articulate part into a Storyline variable. To display this in a text block, you could use the %mySLVar% in the middle of a bit of text or by itself. The two % symbols on either side of a valid variable indicate a "macro" that fills the %X% with your variable value. For example, this:
3 Replies
To split down that URL in JS, you'd want to figure out the rules to use in javascript. In this case, if you wanted to push the middle bit of a URL into a SL variable, you could use:
var player=GetPlayer();
myUrl="https://www.articulate.com/community/"
var urlMeat=myUrl.split('.')[1];
player.SetVar("mySLVar",urlMeat);
This would push the articulate part into a Storyline variable. To display this in a text block, you could use the %mySLVar% in the middle of a bit of text or by itself. The two % symbols on either side of a valid variable indicate a "macro" that fills the %X% with your variable value. For example, this:
Would look like this when the JS has run:
Thanks for helping out here, Steve! :)
Thank you Steve!
This discussion is closed. You can start a new discussion or contact Articulate Support.