AutoText
AutoText enables HTML elements to be populated automatically with the values from scalar, parameter, or array entities through the addition of extra attributes to the HTML elements.
The earlier example showed AutoText being supplied its data from a scalar entity. You can also specify a parameter such as the following:
<span id="parameterText" data-parameter="ParameterOne"></span>
This will bring in the data from a parameter called ParameterOne'.
Because AutoText only displays single values, arrays and sets are not allowed in their entirety. However, with the
data-indices attribute we can pick a single element from an array or set:
<span id="arrayItemText" data-entity="AnArray" data-indices="1" />
![]() |
Note This example has two
data-* attributes, one,
data-entity, to specify the entity by name and the other,
data-indices, to tell AutoText which element in the array entity we want displayed. The attribute is called
data-indices in plural form because an array may have more than one index, in which case you could, for example, write:
<span id="arrayItemText" data-entity="AnArray" data-indices="3,10" /> |
The indices are separated by commas. If you specify an index that does not have an item in that array or set, then the HTML node will be empty. Check the web developer console in your browser for any errors.
The remaining feature of the AutoText component is formatting. This is specified on the individual entity and is covered in the section Entity Formatting.