Expression Functions¶
Built-in functions available in expressions.
String Functions¶
toUpperCase()¶
Convert to uppercase:
toLowerCase()¶
Convert to lowercase:
trim()¶
Remove whitespace:
replace()¶
Replace text:
split()¶
Split into array:
substring()¶
Extract portion:
includes()¶
Check if contains:
startsWith() / endsWith()¶
Check prefix/suffix:
padStart() / padEnd()¶
Pad string:
Number Functions¶
Math.round()¶
Round to nearest integer:
Math.floor() / Math.ceil()¶
Round down/up:
Math.abs()¶
Absolute value:
Math.min() / Math.max()¶
Find minimum/maximum:
toFixed()¶
Format decimal places:
parseInt() / parseFloat()¶
Parse numbers:
Array Functions¶
length¶
Get array length:
join()¶
Join elements:
map()¶
Transform elements:
filter()¶
Filter elements:
find()¶
Find first match:
reduce()¶
Aggregate values:
includes()¶
Check if contains:
indexOf()¶
Find position:
slice()¶
Extract portion:
sort()¶
Sort array:
reverse()¶
Reverse order:
Object Functions¶
Object.keys()¶
Get property names:
Object.values()¶
Get property values:
{{ Object.values($json.data) }} // ["John", 30, "[email protected]"]
Object.entries()¶
Get key-value pairs:
JSON.stringify()¶
Convert to JSON string:
JSON.parse()¶
Parse JSON string:
Date Functions¶
new Date()¶
Create date:
{{ new Date() }} // Current date/time
{{ new Date($json.timestamp) }} // From timestamp
{{ new Date($json.dateString) }} // From string
Date Methods¶
{{ new Date().toISOString() }} // "2024-01-15T10:30:00.000Z"
{{ new Date().toLocaleDateString() }} // "1/15/2024"
{{ new Date().toLocaleTimeString() }} // "10:30:00 AM"
{{ new Date().getFullYear() }} // 2024
{{ new Date().getMonth() }} // 0 (January)
{{ new Date().getDate() }} // 15
{{ new Date().getDay() }} // 1 (Monday)
{{ new Date().getTime() }} // Unix timestamp ms
Date Arithmetic¶
// Add days
{{ new Date(new Date().getTime() + 7 * 24 * 60 * 60 * 1000).toISOString() }}
// Days between dates
{{ Math.floor((new Date($json.end) - new Date($json.start)) / (1000 * 60 * 60 * 24)) }}
Type Functions¶
typeof¶
Check type:
Array.isArray()¶
Check if array:
String()¶
Convert to string:
Number()¶
Convert to number:
Boolean()¶
Convert to boolean:
Utility Functions¶
encodeURIComponent()¶
URL encode:
decodeURIComponent()¶
URL decode:
btoa()¶
Base64 encode:
atob()¶
Base64 decode:
Common Patterns¶
Format Currency¶
Slugify String¶
Extract Domain¶
Format Date¶
{{ new Date($json.date).toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric"
}) }} // "January 15, 2024"