Category / Section
How to Apply Conditional Formatting in a Text Widget
Published:
Conditional formatting in a text widget can be achieved with the help of expression columns and label parameters. This guide will walk you through the process of changing the color and text dynamically in an HTML structure.
Example HTML Structure
<p style="color:red;">I am red</p>
Steps to Apply Conditional Formatting
-
Create a table with the necessary columns.
-
Create an expression using the CONCAT operation and merge all required static and dynamic text (used as columns).
Expression:
CONCAT('<p style="color:',(IF([Status] = 'ON', 'green','red')),';">',[Message],'</p>')
-
Use the created expression (i.e., Formatted Text) as the label parameter for the Text widget.
-
The Text widget will now display conditionally formatted color and text based on the status.
Please refer to the gif image below for a visual representation of the process.