Articles in this section

substring helper

Use the substring helper to extract a portion of a string from the specified start index (inclusive) up to the end index (exclusive). It’s helpful for shortening longer field values or picking out key segments within text.

Usage

{{substring stringField startIndex endIndex}}
  • stringField: The field or variable containing the source string (e.g., record.itemizationCode).

  • startIndex: The 0-based position in the string where extraction begins.

  • endIndex: The 0-based position where extraction ends, not including the character at this index.

Examples

  1. Truncating a code

    If record.itemizationCode is "itemizationCode", then:

    {{substring record.itemizationCode 0 4}}
    

    returns "item".

  2. Extracting part of a memo

    Suppose record.memo is "The quick brown fox jumped over the lazy dog". You can grab "brown fox" with:

    {{substring record.memo 10 19}}
    
  3. Using triple braces for raw output

    {{{substring record.memo 0 9}}}
    

    This avoids any automatic formatting if you want the substring exactly as-is.

Tip

  • Do not wrap the field reference in quotes when referencing it. For example, use {{substring record.description 0 10}}, not {{substring "record.description" 0 10}}.

  • Since endIndex is non-inclusive, {{substring "Celigo" 1 4}} returns "eli".

  • If startIndex or endIndex goes beyond the actual string length, the helper returns only the portion that exists within that range.