Text elements DISPLAY data, they do not STORE data.
A text element does not have a value. It has no output. However, it may display the value of some input.
This is — admittedly — a touch confusing as we can write (and see the value of) expressions in a text element.
However, the result of such expressions are stored nowhere, nor can we reference them. (All we see is their result in the DOM.) We must, instead, just rewrite the expression that lead to the value we are displaying in the text element.
ALTERNATIVELY, we can compute the value we wish to display in the text element and store it somewhere (e.g., in a custom state or in a plugin like List Shifter) and then refer to that “variable” both in our text element and in some other field (such as a conditional).