Forum Discussion

NaveenparbhuRad's avatar
NaveenparbhuRad
Community Member
2 years ago

Can I use Text Entry trigger In storyline 360 to Find a Particular text in a bunch of sentence?

Can Any body help me with this? or is there any other option to identify a particular and triggers the storyline functionality to show a layer using text entry?

  • Hi Naveen

    You can do it using JavaScript. The following demo is a very simple example. The phrase is read and stored in a Javascript variable 'phrase' and the learner text entry in a variable 'learnerentry' they are then both converted to lowercase and the JavaScript code contains the following code:

    if (learnerentry.includes(phrase)) {
       // If the phrase is found, set the Storyline variable to true
        player.SetVar("isPhraseIncluded",true);
    } else {
        // If the phrase is not found, set the Storyline variable to false
        player.SetVar("isPhraseIncluded",false);
    };

    The Storyline variable 'isPhraseIncluded@ is a true/false variable in the Storyline:

    Findphrase (profilelearning.com)

    I am planning a free JavaScript course containing a few examples of data handling using JavaScript for Storyline developers - I will add this example with a full explanation.

    Regards

    John