Articles in this section

trim helper

Use the trim helper to remove any leading or trailing whitespace characters from the specified field or string. This is particularly useful when dealing with data that may have extra spaces before or after meaningful text.

Usage

{{trim field}}
  • field: The field or variable containing the text to be trimmed (e.g., record.name).

Examples

  1. Trimming whitespace from a record field 

    If record.artist is " Lalo Schifrin ", then:

    {{trim record.artist}}

    returns "Lalo Schifrin" (with leading and trailing spaces removed).

  2. Using triple braces for raw output 

    {{{trim record.title}}}

    Returns the cleaned string without any automatic formatting—e.g., "Danube Incident" if the original value had extra whitespace.

Tip

  • Trimming helps avoid issues where strings appear identical but contain hidden or unintended spaces.

  • You typically don’t need quotes for numeric fields, but if you do pass a string literal directly (e.g., " Hello "), ensure it’s quoted properly.

  • If the original string has only whitespace or is empty, trim returns an empty string.