Linked text

Numbers and words working together

Introduction

One of the greatest benefits of using a notebook over a dashboard is the ability to annotate your analysis, but it is important to keep your text and data in-sync.

With linked text you can embed results from any cell into the body of your text, meaning your story is always consistent.

What is linked text?

Linked text is a dynamic snippet of text which shows a single value from the results of a cell. The linked text is

  • Highlighted while in draft and published modes

  • Cannot be edited once created, only deleted

  • Reactive - it updates as soon as a cell or control it depends on updates

Linked text in action, showing the current value of an interactive control.

How to add linked text

Linked text can be placed in:

  • Any part of a text block, including headers and quotes.

  • Cell output titles

The syntax for creating linked text is below. Once the last bracket is typed, the linked text will become highlighted, and no longer editable.

#cellName.columnName[row_index]

row_index begins at 1 for the first row of the table

In the example below, the text block contains two linked text components. The first one selects the first entry in the numbers column, and the second one selects the second entry. While in draft mode, the linked text syntax remains visible. Once in published mode, the linked text syntax is replaced with the computed value (after the cell has executed).

The appearance of linked text in draft and published modes.

Tips for using linked text

Make sure you're sorting

Often you may want to use linked text to highlight the maximum/minimum value in a column. As linked text needs the column entries to always occur at the same row index, in this case you should ensure that the column is sorted first and pick the first value.