How do I do a wildcard search in Storyline 2?

Jul 29, 2015

How do I do a wildcard search in Storyline 2?

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. 

For example if the url = https://www.articulate.com/community/

But I only want to make sure the url has articulate in it,

is this a proper wildcard check in Storyline 2? ... %articulate%.  Thanks in advance.

3 Replies
Steve Flowers

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:

  • The URL you're looking at has %mySLVar% in it.

Would look like this when the JS has run:

  • The URL you're looking at has articulate in it.

This discussion is closed. You can start a new discussion or contact Articulate Support.