logo
Schedulin

JSONata expressions

JSONata is the expression language Schedulin uses to transform data between workflow steps. If you've used JSONPath, jq, or Excel formulas, the concepts will feel familiar.

Where you use it

Anywhere a step accepts an expression instead of a literal value — typically the Transform step, or any input that supports {{...}} interpolation.

Basic patterns

// Pull a field
post.caption

// Pull a nested field
analytics.instagram.likes

// String concatenation
"New post: " & post.title & " → " & post.url

// Conditional
post.engagement > 1000 ? "viral" : "normal"

Working with arrays

// Get all post URLs
posts.url

// Filter array
posts[engagement > 100]

// Map to a new shape
posts.{ "title": title, "score": engagement / impressions }

// Aggregate
$sum(posts.engagement)
$count(posts)

Common Schedulin patterns

Build a post caption from analytics:

"This week's top post: " & topPost.title &
" (" & topPost.likes & " likes, " & topPost.comments & " comments)"

Filter to only failed posts in the last 24h:

posts[status = "failed" and publishedAt > $millis() - 86400000]

Reshape an external webhook payload into a Schedulin post:

{
  "channels": ["twitter-main"],
  "caption": title & " " & url,
  "scheduledAt": pubDate
}

Testing expressions

In the workflow editor, every expression input has a Preview button. It runs the expression against the sample data from the trigger and shows the result. Iterate on the expression until the preview looks right.

Reference

Full JSONata docs: jsonata.org. Schedulin supports the full language plus a few built-in helpers for dates and channels.

See also