Forum Discussion

SpencerLewis-42's avatar
SpencerLewis-42
Community Member
3 years ago

Allowing multiple lines in text variable

Greetings, e-learning fellows.

I am running into a bit of an issue with regard to text variables, and I am a little confused.

I am creating an interactive glossary of terms that allows students to open the term and definition in Google Translate using javascript to build a URL and open it in a new tab.

We have been using a version of this glossary for several years with great success.

The issue I am running into is that in the past, I have had to remove all line breaks from the definition to make it a single line of text because the text variables in Storyline do not allow me to include line breaks.

I was creating a tool for other IDs to generate the URL and copy it to be used in other tools such as Rise or static pages. As I was building this tool, I discovered that when used with a Text Entry field, the variable allowed for line breaks, and I could successfully generate an encoded URL where I replaced all line breaks with the URL code for a new line. 

My question is, why does the Text Entry field allow line breaks (allowing me to create a URL with multiple paragraphs or alternate definitions for a word), and when I try to manually define the variable in a trigger, it does not work? Is that a limitation of the application?

The screenshots below show that it is possible.

Here is an example of the tool I am building to demonstrate that multiple lines can be sent to Google Translate. Try adding multiple paragraphs to the definition field. 

Any insight and help would be greatly appreciated.

 

  • Interestingly when I posted this, a related discussion came up, Line breaks in text variable.

    In that discussion, I found the suggestion to paste the text into the notes area and do my formatting there. I followed those instructions but had to remove all the line breaks that were pasted with the text and recreate them in the notes section. I was able to assign a multi-line text to a text variable using triggers.

    Trigger before:

    Trigger After:

    To determine the type of character being passed into the string by pasting the lines into Word and showing all characters. I cannot tell what character the notes section is using for their line breaks.

    Any thoughts?