4.1 Using Data Values in HTML Expressions
When fine-tuning data formatting, to reference the value of page item
P1_NAME use
&P1_NAME. starting with an ampersand and ending with
a dot. This also works to reference application items, built-in substitution strings, and
column values in HTML expressions for regions like Cards, Content Row, Template Components,
and Interactive Grid.
For example, consider a content row region based on the DEPT table where you need to reference the DNAME and LOC column values in the HTML expression for the Overline slot. You can use:
<strong>&DNAME.</strong> → &LOC.In contrast, when working with columns in a Classic Report or Interactive Report, or
when defining your own templates, use #NAME# instead. For
example, imagine a classic report region based on the DEPT table where
you want to format the department name column in a custom way. You can use the value of
both DNAME and LOC columns in the
DNAME column's HTML Expression as follows.
If you also set the LOC column type to be Hidden then it won't
occupy an additional column.
<strong>#DNAME#</strong> → #LOC#When using a page item or region source's column value in an HTML attribute, use the additional !ATTR qualifier as shown
below to ensure the page formats the value correctly to be used for that purpose:
<a href="#TARGET_LINK!ATTR#"><strong>#DNAME#</strong></a>If the column value itself includes HTML markup, use the !RAW qualifier to avoid the default escaping of characters like <, >, and & that have special meaning in HTML. For example, if a DESCRIPTION_IN_HTML column contains HTML markup, then reference it like this to ensure the browser sees the HTML markup as intended:
<i>#DESCRIPTION_IN_HTML!RAW#</i>These qualifiers also work for &NAME!RAW. and &NAME!ATTR. use cases.
Parent topic: Referencing Data Values in Pages