Report templatesFunctions
isNotEmpty
Check if an array or object is not empty
Usage
The isNotEmpty function checks whether an array has elements or an object has properties.
Syntax
{input | isNotEmpty}Parameters
input(array or object): The collection to check
Returns
trueif the array has at least one element or object has at least one propertyfalseif the array is empty, object has no properties, or input is neither array nor object
Examples
Non-empty array
{["item1", "item2"] | isNotEmpty}
// Returns: trueEmpty array
{[] | isNotEmpty}
// Returns: falseObject with properties
{{"name": "John", "age": 30} | isNotEmpty}
// Returns: trueEmpty object
{{} | isNotEmpty}
// Returns: falseConditional rendering
{vulnerabilities | isNotEmpty}
// Returns true if vulnerabilities collection has itemsWith null/undefined
{null | isNotEmpty}
// Returns: falseString input
{"text" | isNotEmpty}
// Returns: false (not an array or object)Use Cases
- Conditional rendering of sections based on data presence
- Validation before processing collections
- Showing/hiding empty state messages
- Pre-checks before iteration
- Data availability checks in templates
Common Patterns
Show section only if data exists
{#if findings | isNotEmpty}
// Render findings section
{/if}Display count or empty message
{scope | isNotEmpty ? "Scope defined" : "No scope defined"}