You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1089,13 +1089,17 @@ This URL will only work if I have `customer_id` included in my results table.
1089
1089
1090
1090
The `richText` property allows you to define custom HTML/Markdown templates for displaying dimension and metric values in table cells. This enables sophisticated data presentation with formatting, styling, conditional logic, and external integrations.
1091
1091
1092
+

1093
+
1092
1094
<Info>
1093
-
Rich text only affects UI display in table cells. It has no impact on value formatting, CSV exports, or the underlying data values.
1095
+
Rich text only renders in the **Table chart visualization**. It does not affect the Results panel below the explore, CSV/Excel exports, or the underlying data values. To see your `richText` take effect, switch the chart type to **Table**.
1094
1096
</Info>
1095
1097
1098
+
`richText`is supported on both **dimensions** and **metrics**. It accepts Markdown, inline HTML, and [LiquidJS](https://liquidjs.com/) templating. HTML is sanitized with a GitHub-safe allowlist that permits inline `style` attributes but strips `<script>`, `<iframe>`, and event handlers (e.g. `onclick`). External links automatically open in a new tab.
1099
+
1096
1100
### Basic example
1097
1101
1098
-
Display a dimension value with custom formatting:
1102
+
Display a dimension value with bold text, an inline code span, and clickable links:
1099
1103
1100
1104
<Tabs>
1101
1105
<Tab title="dbt v1.9 and earlier">
@@ -1107,8 +1111,8 @@ Display a dimension value with custom formatting:

1146
+
1141
1147
### Conditional formatting
1142
1148
1143
-
Use Liquid control flow tags for conditional display based on values:
1149
+
Use Liquid control flow tags to switch rendering based on the value — for example, to tier a metric with emoji indicators and a matching text label. Always guard against `nil` so empty cells render gracefully:
1144
1150
1145
1151
<Tabs>
1146
1152
<Tab title="dbt v1.9 and earlier">
@@ -1152,15 +1158,17 @@ Use Liquid control flow tags for conditional display based on values:
1152
1158
average_clv:
1153
1159
type: average
1154
1160
richText: |
1155
-
{% raw %}{% if value.raw >= 100 %}
1161
+
{% raw %}{% if value.raw == nil %}
1162
+
<span style="color: #999;">No data</span>
1163
+
{% elsif value.raw >= 100 %}
1156
1164
### 📈 ${ value.formatted }
1157
1165
**Excellent** Average CLV
1158
1166
{% elsif value.raw >= 50 %}
1159
1167
### 📊 ${ value.formatted }
1160
1168
**Good** Average CLV
1161
1169
{% else %}
1162
1170
### ⚠️ ${ value.formatted }
1163
-
**Low** Average CLV
1171
+
**Low** Average CLV - _Needs attention!_
1164
1172
{% endif %}{% endraw %}
1165
1173
```
1166
1174
</Tab>
@@ -1174,15 +1182,17 @@ Use Liquid control flow tags for conditional display based on values:
1174
1182
average_clv:
1175
1183
type: average
1176
1184
richText: |
1177
-
{% raw %}{% if value.raw >= 100 %}
1185
+
{% raw %}{% if value.raw == nil %}
1186
+
<span style="color: #999;">No data</span>
1187
+
{% elsif value.raw >= 100 %}
1178
1188
### 📈 ${ value.formatted }
1179
1189
**Excellent** Average CLV
1180
1190
{% elsif value.raw >= 50 %}
1181
1191
### 📊 ${ value.formatted }
1182
1192
**Good** Average CLV
1183
1193
{% else %}
1184
1194
### ⚠️ ${ value.formatted }
1185
-
**Low** Average CLV
1195
+
**Low** Average CLV - _Needs attention!_
1186
1196
{% endif %}{% endraw %}
1187
1197
```
1188
1198
</Tab>
@@ -1193,20 +1203,117 @@ Use Liquid control flow tags for conditional display based on values:
1193
1203
type: average
1194
1204
sql: ${customer_lifetime_value}
1195
1205
richText: |
1196
-
{% raw %}{% if value.raw >= 100 %}
1206
+
{% raw %}{% if value.raw == nil %}
1207
+
<span style="color: #999;">No data</span>
1208
+
{% elsif value.raw >= 100 %}
1197
1209
### 📈 ${ value.formatted }
1198
1210
**Excellent** Average CLV
1199
1211
{% elsif value.raw >= 50 %}
1200
1212
### 📊 ${ value.formatted }
1201
1213
**Good** Average CLV
1202
1214
{% else %}
1203
1215
### ⚠️ ${ value.formatted }
1204
-
**Low** Average CLV
1216
+
**Low** Average CLV - _Needs attention!_
1217
+
{% endif %}{% endraw %}
1218
+
```
1219
+
</Tab>
1220
+
</Tabs>
1221
+
1222
+

1223
+
1224
+
<Note>
1225
+
Liquid blocks inside dbt YAML must be wrapped in `{% raw %}...{% endraw %}` so dbt's Jinja engine passes the template through to Lightdash untouched.
1226
+
</Note>
1227
+
1228
+
### HTML, images, and inline styles
1229
+
1230
+
For richer layouts, combine inline HTML with images and `style` attributes. This example renders an avatar image alongside the name with a secondary link underneath:
0 commit comments