Implementing a Search Bar for an E-Learning Course using js

Apr 03, 2023

Hello Heroes, I'm doing a search bar based on this post: https://community.articulate.com/discussions/articulate-storyline/build-custom-search-within-storyline-using-javascript-763861c5-9886-4e1f-9c13-b7b9a56f3ba3

I made a few changes to make it easier to add new words an link them to a certain slide, but I can't get it to work. Here's my code:

var player = GetPlayer();

var parameters = player.GetVar("searchfield");

var lower = parameters.toLowerCase();
var keys = ["renting","facturation","video"];

keys.forEach((key)=>{
    var termlocation  = keys.indexOf(key);
    if(key==lower){
        player.SetVar("placement",termlocation);
    }
});

thank you for your time.

 

Be the first to reply