Utility functions
Empty
The empty(value) checks if the variable exists and if the value is not “falsy”. Returns true if var does not exist or has a value that is empty or equal to zero, aka falsely. Otherwise, it returns false.
{% empty({dataField}) ? 'No value' : 'Field has value' %}
What qualifies as "falsy"?
- Anything that returns false if cast to boolean
- Empty array
- Zero as number
- Zero as string
- Empty string
- null
- false
- undefined
JSON decode
Decode JSON string to use in an expression.
{% json_decode('{"key": "value"}', true) %}
Related articles you may find helpful
- Checkbox & Radio button Component
- How to create Nested Array (Multidimensional Array)?
- Is it possible to conditionally change the component style or hide the component?
Updated on: 04/09/2025
Thank you!
