Format rules enable you to change the way information is displayed throughout your app.
About format rules
Format rules allow you to customize icons, text, and more. This helps you make your app more unique. You can also make different formatting rules for each row, creating different formatting for different data.
An app can define more than one format rule and, in fact, more than one rule can match the same data at the same time. In such cases, the order of the formatting rules in the app determines the actual behavior.
The rules are processed in order from the first to the last. If two matching rules conflict in their formatting information, the last rule takes precedence. So for example, if Rule 1 matches and sets the Text Size to 1.5 and Rule 2 also matches and sets the Text Size to 2.5, the final Text Size will be 2.5.
In the case of icons, the rules are additive. So if Rule 1 matches and assigns an icon and Rule 2 also matches and assigns an icon, both icons are shown for the data.
Use format rules
To use format rules:
- Open your app in the editor.
- Go to the UX > Format rules pane.
- Click + New Format Rule.
- Configure the following properties:
Property Description Rule name Name of the format rule. For this data Table that the rule applies to. If this condition is true Condition that must be satisfied for the formatting rule to take effect. If you leave this blank, the rule applies to all rows in the table. However, you could specify a simple formula like
[Country] = "USA"or a more complex formula for richer behaviors
Format these columns and actions
Columns in the table that you want formatted. Hold down the
Ctrlkey to select multiple items.
Optionally, as shown in the above figure, you can customize the visual, text, and workflow template format, or provide a descriptive comment for the format rule by expanding the additional sections. For example:
Show an icon next to the row, inside the map pin, or on any UX view.
Expand the Visual Format section to set icons based on rules for the data in your app. Make sure to select any column where you would like the icon featured (choose your location column to feature icons inside map pins instead of numbers). You can browse through the icons and click on the one you want to use, or search for a specific icon using the text box. Note: Adding icons will affect the size of columns in the Table view. For example:
Customize the text and highlight colors from the list of theme-based colors.
Highlight color determines the color of the icon. You can also manually type in any hex-based color code you want, such as
#0F77FF. You can use this tool to find color codes: http://www.colorpicker.com
The image below shows the results of the visual customizations in the format rule.