Skip to content

Building reports

Liquid templating

Use Liquid expressions inside Golden Reports blocks to render dynamic text, format values, and apply conditional logic.

A report template is HTML + Liquid - the same languages you'd write for any web page, plus the Liquid templating language for placeholders and conditional logic. Liquid is widely used across the web (Shopify, Jekyll, and many static-site generators); if you've seen {{ ... }} placeholders before, you already know most of it.

The Liquid layer is where you write tiny snippets of code; everything else is plain HTML or block properties bound to data.

If you've used Liquid before, you'll feel at home. If you haven't, the rest of this page is enough to handle every common case.


What's available inside a Liquid expression

Anywhere in the template - inline in HTML, inside a block's property, in a text node - two kinds of names are in scope:

  1. The query result - the data returned by the report's GraphQL query.
  2. Variables - the names defined in the Variables panel.

Parameters are not directly available; map them to a variable first. See Parameters, variables & queries for the why.


The basics

Liquid has three constructs that matter:

Output - {{ expression }} evaluates and prints.

Hello {{ customer.name }}.
Order total: {{ invoice.total }}.

Logic - {% if ... %} and friends.

{% if invoice.total > 10000 %}
  Thank you for your large order!
{% else %}
  Thank you for your order.
{% endif %}
Previous
Parameters, variables & queries