Article Type: Configuration / How-To
Audience: Application Designers, Partners
Module: Screen Designer
Applies to Versions: 2024.1+
Estimated Time: 15-30 minutes
Conditional formatting allows you to dynamically style table cells based on data values, enhancing data visualization and user comprehension. You can apply background colors, text colors, and other CSS properties to cells based on record status, performance metrics, threshold values, or any data-driven criteria. This guide covers both background color and text color formatting techniques.
#FF5733 or RGBA values like rgba(255,87,51,1)) or a data transform that calculates colorsNavigate to your table screen and select the column you wish to format.
The Display section contains the Styles property where you define conditional formatting using a JSON object with CSS properties.
</>) to switch from basic configuration to advanced mode for entering JSON expressionsBackground Color Only:
{
"background": data.color
}Text Color Only:
{
"color": data.yieldColor
}Combined Background and Text Color:
{
"background": data.bgColor,
"color": data.textColor
}Multiple CSS Properties:
{
"alignItems": "center",
"color": data.yieldColor,
"fontWeight": data.isCritical ? "bold" : "normal"
}The Data Path field determines what value displays in the cell. You have two options:
"" to show just the background color without textcolor or status.name) to show the value with conditional formatting appliedWhen your styling references fields not in the Data Path, you must add them to Additional Fields to ensure the system queries them.
color, status.color, yieldColor)If your conditional styling depends on data from other columns, page context, or values that change dynamically, configure the Dynamic Fields property to override cached values.
{
"payload": null,
"context": []
}Add field references to the context array when your styling logic references data from elsewhere on the page.
| Property | Example Value | Description |
|---|---|---|
background |
data.color |
Cell background color |
color |
data.textColor |
Text color within the cell |
fontWeight |
"bold" or "normal" |
Text weight (bold, normal, 100-900) |
fontStyle |
"italic" |
Text style (normal, italic) |
textDecoration |
"underline" |
Text decoration (underline, line-through) |
alignItems |
"center" |
Vertical alignment within the cell |
| Format | Example | Description |
|---|---|---|
| Hex | #FF5733 |
6-character hexadecimal color code |
| Hex (short) | #F53 |
3-character shorthand hex code |
| RGBA | rgba(255,87,51,0.8) |
RGB with alpha transparency (0-1) |
| RGB | rgb(255,87,51) |
RGB color values (0-255) |
| Named | red, green, blue |
CSS named colors |
Success Criteria:
Testing Scenarios:
| Issue | Cause | Solution |
|---|---|---|
| Color not displaying | Field not included in query | Add the color field to Additional Fields |
| Invalid color value | Malformed hex or RGBA value | Verify color format (include # for hex, use commas in RGBA) |
| Related model color not showing | Incorrect data path reference | Use full path: data.status.color for related models |
| Color not updating dynamically | Cached value not refreshing | Configure Dynamic Fields to include dependent data sources |
| Text unreadable | Poor contrast between text and background | Add complementary text color styling or adjust background colors |
| Performance issues with large tables | Column-level transforms for each row | Use table-level data transforms for better performance |
| JSON syntax error in Styles | Missing quotes, commas, or brackets | Validate JSON structure; property names must be in double quotes |
color column). Add this field to Additional Fields in your table query. This allows end users to modify colors through normal data entry without requiring screen redesign, creating a more flexible and maintainable solution.
Performance Optimization:
Configurable Thresholds Pattern:
For dynamic, user-configurable color thresholds (e.g., yield targets that change by product or season), create a configuration table that stores boundary values and associated colors. Reference this configuration in your table query and use JSONata expressions to determine the appropriate color based on the current value and configured thresholds.
| Version | Date | Editor | Description |
|---|---|---|---|
| 1.0 | 2023-10-05 | Fuuz Team | Initial Release - Background color formatting |
| 2.0 | 2025-01-11 | Fuuz Team | Added text color formatting, Dynamic Fields, performance guidance, and best practices |