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.
{{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.
-
Truncating a code
If
record.itemizationCodeis"itemizationCode", then:{{substring record.itemizationCode 0 4}}returns
"item". -
Extracting part of a memo
Suppose
record.memois"The quick brown fox jumped over the lazy dog". You can grab"brown fox"with:{{substring record.memo 10 19}} -
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
endIndexis non-inclusive,{{substring "Celigo" 1 4}}returns"eli". -
If
startIndexorendIndexgoes beyond the actual string length, the helper returns only the portion that exists within that range.