Skip to content

Instantly share code, notes, and snippets.

@mikhin
Created September 27, 2025 18:04
Show Gist options
  • Select an option

  • Save mikhin/ba3f88335b831424dc6bf3d2859ab563 to your computer and use it in GitHub Desktop.

Select an option

Save mikhin/ba3f88335b831424dc6bf3d2859ab563 to your computer and use it in GitHub Desktop.

Formula Syntax Reference

Transform input connectors into computed text using template expressions.

Quick Start

Access connector values using {{ connectors[0] }}, {{ connectors[1] }}, etc.

Example: If connectors contain ["Hello", "World"]

{{ connectors[0] }} {{ connectors[1] }}!

Output: Hello World!


Variables & Access

  • {{ connectors[0] }} - First connector value
  • {{ connectors[1] }} - Second connector value
  • {{ connectors.length }} - Total number of connectors
  • {{ connectors.0 }} - Alternative syntax for first item

Text Filters

Transform text using the pipe | operator:

Filter Example Result
upcase {{ connectors[0] | upcase }} UPPERCASE
downcase {{ connectors[0] | downcase }} lowercase
capitalize {{ connectors[0] | capitalize }} Capitalized
strip {{ " text " | strip }} text
truncate: 10 {{ connectors[0] | truncate: 10 }} Truncate...
replace: "old", "new" {{ connectors[0] | replace: "a", "X" }} Replace text
append: " text" {{ connectors[0] | append: "!" }} Add to end
prepend: "text " {{ connectors[0] | prepend: "→ " }} Add to start
escape {{ "<html>" | escape }} <html>

Chain filters: {{ connectors[0] | upcase | truncate: 5 }}


Array Filters

Filter Example Result
join: ", " {{ connectors | join: ", " }} item1, item2
size {{ connectors | size }} 3
first {{ connectors | first }} First item
last {{ connectors | last }} Last item
default: "fallback" {{ empty | default: "N/A" }} N/A

Conditionals

{% if connectors %}
  Connected: {{ connectors | size }} items
{% endif %}

{% unless connectors %}
  No connections
{% endunless %}

Loops

{% for item in connectors %}
  {{ item }}{% unless forloop.last %}, {% endunless %}
{% endfor %}

Loop variables: forloop.first, forloop.last, forloop.index, forloop.length


Common Patterns

List with bullets:

{% for item in connectors %}
• {{ item | capitalize }}
{% endfor %}

Conditional formatting:

{% if connectors.length > 0 %}
Total: {{ connectors | size }} - {{ connectors | join: ", " }}
{% endif %}

Numbered list:

{% for item in connectors %}
{{ forloop.index }}. {{ item }}
{% endfor %}

⚠️ Limitations

These Liquid features are not supported:

  • {% assign %} - Cannot create variables
  • {% elsif %} / {% else %} - No else branching
  • {% if A == B %} - No comparison operators (==, >, <, contains)
  • {% if A and B %} - No logical operators (and, or)
  • ❌ Math filters (abs, ceil, floor, round)
  • split, sort, reverse - Limited array operations

Workaround: Use nested {% if %} / {% unless %} for complex logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment