Forum Discussion

BrentMiller-1e7's avatar
BrentMiller-1e7
Community Member
20 days ago

Formatting Slide Text From JavaScript

Hello!

In Storyline 360, we've created an inventory of items for users to select from.

We're trying to output a dynamic list of items and description pairs from the selected items on a subsequent slide.

Can this be output in a heading/paragraph format? We're already collecting the selection in JavaScript code, and the associated description will be hardcoded into that.

We tried the following format, which does work, but only outputs a string:

 

if (ACESTraining == true) {
    Considerations.push("You selected Adverse Childhood Experiences (ACES) training for staff. Specific feedback here.");

 

We then tried formatting with HTML, which seems to strip the tags and doesn't end up formatting the way we want

if (ActiveShooterDrills == true) {
    Considerations.push("<h2>Active Shooter Drills</h2><p>Specific feedback here.</p>");
}



 

1 Reply

  • Nedim's avatar
    Nedim
    Community Member

    One of Storyline 360’s limitations is that it strips or escapes HTML tags when inserting content into text boxes via variables. As a workaround, you might consider storing headings and descriptions separately in JavaScript arrays, then passing them to two different Storyline variables (e.g., one for titles, one for descriptions). You can style the text boxes differently within Storyline to simulate heading/paragraph formatting. Just a thought. I’m not sure exactly how your setup looks, but this could be an option worth exploring.