The substring helper extracts a portion of a string from a specified start index up to (but not including) a specified end index. Use it to truncate values, extract fixed-position codes, or isolate key segments within text fields.
Syntax
{{substring stringField startIndex endIndex}}
stringField -- The string or field to extract from. Required. Do not wrap field references in quotes: use record.description, not "record.description".
startIndex -- The zero-based position where extraction begins (inclusive). Required.
endIndex -- The zero-based position where extraction ends (exclusive). Required. The character at this position is not included in the output.
Examples
Extract the first four characters of a code
{{substring record.itemizationCode 0 4}}
Input: record.itemizationCode is "itemizationCode"
Output: item
Characters at positions 0, 1, 2, and 3 are returned. The character at position 4 is excluded.
Extract a word from within a string
{{substring record.memo 10 19}}
Input: record.memo is "The quick brown fox jumped over the lazy dog"
Output: brown fox
Return raw output with triple braces
{{{substring record.memo 0 9}}}
Use triple braces when downstream systems require the exact substring without Celigo's automatic formatting.
Usage notes
-
endIndexis exclusive:{{substring "Celigo" 1 4}}returns"eli", not"elig". - If
startIndexorendIndexexceeds the string length, the helper returns only the portion that exists within the specified range. - Do not wrap field references in quotes.
{{substring record.description 0 10}}is correct;{{substring "record.description" 0 10}}treats the field name as a literal string.