String methods
Split
Split a string by a delimiter to extract specific parts. Example: Extract domain from email address- Input:
nodes.start.email = "john.smith@acme-corp.com"
- Output:
"acme-corp.com"
toLowerCase
Convert a string to lowercase for consistent formatting. Example: Standardize company name- Input:
nodes.start.companyName = "ACME Corporation"
- Output:
"acme corporation"
toUpperCase
Convert a string to uppercase. Example: Format country code- Input:
nodes.start.country = "us"
- Output:
"US"
Array methods
length
Count how many items are present in an array Example: Count the number of stakeholders found- Input:
nodes.array = ["John Smith", "Sarah Johnson", "Mike Davis", "Lisa Chen"]
- Output:
4
includes
Check if a value exists in an array. Example: Check if the product is in an allowed list- Input:
nodes.start.product = "posters"
- Allowed products:
["posters", "calendars", "books", "cards"]
- Output:
true
slice
Extract a portion of an array. Example: Limit stakeholders to first 5- Input:
nodes.apollo.stakeholders = "John", "Sarah", "Mike", "Lisa", "David", "Emma", "Tom"]
- Output:
["John", "Sarah", "Mike", "Lisa", "David"]
filter
Create a new array based on a condition. Example: Filter case study URLs- Input:
nodes.start.urls = ["https://example.com/case-studies/tech", "https://example.com/blog", "https://example.com/case-studies/finance"]
- Output:
["https://example.com/case-studies/tech", "https://example.com/case-studies/finance"]
join
Convert an array to a string with a delimiter. Example: Convert countries to comma-separated string- Input:
nodes.start.countries = ["US", "CA", "UK", "DE"]
- Output:
"US, CA, UK, DE"
map
Transform each element in an array. Example: Add company data to stakeholders- Input:
nodes.apollo.stakeholders = [
{"name": "John", "title": "CEO"},
{"name": "Sarah", "title": "CTO"}
]
- Company data:
nodes.start.domain = "acme.com", nodes.hubspot.companyId = "12345"
- Output:
[
{"name": "John", "title": "CEO", "domain": "acme.com", "hubspotId": "12345"},
{"name": "Sarah", "title": "CTO", "domain": "acme.com", "hubspotId": "12345"}
]
concat
Merge two arrays together. Example: Combine prospect lists- Input:
nodes.start.countries1 = ["US", "CA"], nodes.start.countries2 = ["UK", "DE"]
- Output:
["US", "CA", "UK", "DE"]
Date and time
new Date()
Create a timestamp. Example: Get current timestamp- Output:
"2024-01-15T10:30:45.123Z"
toLocaleDateString()
Format date in localized format. Example: Format current date- Output:
"1/15/2024"
Mathematical operations
Basic arithmetic
Perform calculations on numbers. Example: Calculate win rate- Input:
nodes.start.wins = 15, nodes.start.total = 50
- Output:
30
Common patterns
Conditional logic
Use ternary operators for simple conditions. Example: Set priority based on score- Input:
nodes.start.score = 85
- Output:
"High Priority"
Object property access
Access nested properties using dot notation. Example: Extract the city from a nested address- Input:
nodes.start = {
"user": {
"address": {
"city": "San Francisco"}
}}
- Output:
"San Francisco"
Null checking
Safely access properties that might not exist. Example: Get theme with default fallback- Input:
nodes.start = {
"user": {
"preferences": null
}}
- Output:
"default"
Tips
- Access the autocomplete feature while writing expressions using
/
on your keyboard - You cannot use a node’s outputs inside an expression when the node isn’t connected to the prior nodes in the execution logic
- Always wrap expressions in double curly brackets:
{{ expression }}
- Use dot notation to access nested object properties
- Arrays are zero-indexed in JavaScript