Column Pattern Formatting
You can configure the appearance of a column by either:
- Defining a column pattern.
- Setting column options within the component editor.
- Adding an _SD_FORMATTER within the column name.
Below we detail how column pattern formatters allow configuring multiple columns at once using wildcard matching.
Configuring Multiple Columns using Patterns
You may have many columns with similar names, or dynamic columns that only appear after a form or query change. Column patterns allow you to match these columns using simple wildcard rules and apply formatting to all of them at once.
Patterns use wildcard matching (not raw JavaScript regular expressions).
The asterisk (*) matches any number of characters, and matching is applied to the entire column name.
How to Create a Column Pattern
- Within the component editor, click
Add Column Pattern. - Enter a column name pattern using wildcards (
*). - In the pattern editor or collapsible panel, configure the formatting options. All matching columns will automatically inherit these settings.
When you create a pattern, a new expandable section appears for configuring all matching columns.
Wildcard Pattern Examples
| Pattern | Matches | Description |
|---|---|---|
BID* |
BID, BID1, BID2 |
All columns starting with BID |
*BID* |
MY_BID_1, YOUR_BID_2 |
All columns containing BID |
*3 |
BID3, ASK3, MID3 |
All columns ending with 3 |
ASK |
ASK |
Exact column name match |
* |
All columns | Apply formatting to every column in the table |
Regex Patterns (Advanced)
By default, column patterns use simple wildcard matching.
For advanced use cases, you may explicitly opt in to full JavaScript regular expressions
by prefixing the pattern with regex:.
Regex patterns are powerful but should be used with care. They are case-sensitive and are applied exactly as written. Invalid regular expressions will not be applied.
Regex Examples
| Pattern | Matches | Description |
|---|---|---|
regex:^BID\d+$ |
BID1, BID2, BID3 |
All BID columns followed by a number |
regex:^ASK.* |
ASK, ASK1, ASK_PRICE |
All columns starting with ASK |
regex:.*_BID_.* |
MY_BID_1, YOUR_BID_2 |
Columns containing _BID_ |
regex:^(BID|ASK)$ |
BID, ASK |
Exact match of multiple column names |
Note: When using regex:, the pattern is treated as a raw JavaScript regular expression.
Wildcard rules (*) are not applied, and special characters must be properly escaped.
Configure Multiple Table Columns
Notice that a column-specific configuration always overrides a pattern-based configuration.
Example Code Used
Run the following query against the built-in DEMODB database to recreate the example shown above.