Design
Filtering arrays
Filter your array
COMMUNITY FEATURE
Available for:
Carbone Cloud
Carbone On-premise
Embedded Carbone JS
v2.0+
If you want to hide a row in a table, consider using the Smart Conditional Block. This prevents the need to repeat array filters across all tags. Check the simple example below.
Number filters
You can use conditional operators to filter arrays: >
, <
, >=
, <=
, =
, !=
.
Filters must be the same on all tags if you want to keep only matching rows. Otherwise, only the tag is hidden, not the entire row.
Use Alias to simplify report maintenance.
String filters
Filtering with string is also possible as the following example:
Filter the first N items
Filtering the loop index is also possible as the following example:
Exclude the last N items
Negative loop index i
is accepted to print all elements except the last N-th items:
Smart filter
Sometimes, it is easier to use Smart Conditional Block to hide a row in a table:
You can use complex conditions with formatters.
Advanced filter
Coming soon in Carbone v5: Filter with formatters and complex conditions, with reduced repetition