Use Text Widgets in Analytic Applications

You add the text widget to your analytic application to enter text or apply dynamic text to it.

The text widget is used in both stories and analytic applications. Only the properties specific for the analytics designer are listed here.

To add a text widget, from the toolbar select Start of the navigation path Next navigation step TextEnd of the navigation path.

Note

You can't add emojis to texts.

Define Source of Dynamic Text

You can define the following elements as the source of dynamic text in analytic applications as in stories:
  • Analytic Application Properties
  • Input Controls
  • Tile Filters & Variables
  • Model Variables
Note

Dynamic text with team signature as source isn't supported.

For how to add dynamic text and more information, see Adding Dynamic Text to a Story.

In addition, you can choose Script Variables as the source of dynamic text.

Note
Only variables of string, number or integer types can be used. Variables set as array aren't supported.

At runtime, the global variables will change according to the customized scripts, and their values will be automatically updated in the text widget.

Use APIs to Get, Apply Text and Handle Line Breaks

You can use getPlainText() API to get the text with line breaks kept and applyText() API to change the text in the text widget. You can use \n in the applyText() API to add line breaks in the text widget.

Example

In this example, when the application user clicks on the button at runtime, a new line This is a new paragraph. appears under the current text in the text widget Text_1.

To achieve this, write the following script in the button's onClick event:

Sample Code
var currentText = Text_1.getPlainText();
Text_1.applyText(currentText + "\nThis is a new paragraph.");

Before:

After: