Skip to main content

Get Text Segment

Command description

Extract a segment from text using the specified start position and extraction method, then save it as a new text variable.

Command Input Parameters

input parametersInput parameter typeDescription
Text ContentanySource content. Lists are joined with newline characters; other values are converted to text first.
Start PositionenumFrom First Character, From Specified Position, From Specified Text
Start Character Positionint or strRequired only when Start Position is From Specified Position. Positions are zero-based.
Start TextanyRequired only when Start Position is From Specified Text. Extraction starts at the first occurrence of this text.
Extraction MethodenumTo Last Character, Specified Length
Extraction Lengthint or strRequired only when Extraction Method is Specified Length. Must be at least 0.

Command Output Parameters

Output parametersOutput parameter typeDescription
Extracted ResultstrExtracted text

Note

If Text Content is a list, its items are joined with newline characters. Other values are converted with str(), so None becomes "None".

Start Character Position and Extraction Length must be integers or text values that can be converted to integers.

When extracting from a specified position, Start Character Position is required and cannot be negative. Positions are zero-based. A position at or beyond the end of the source returns an empty string.

When extracting from specified text, Start Text is required. Extraction begins at the first match and includes Start Text. An error is raised if no match is found.

When using Specified Length, Extraction Length is required and cannot be negative. A length of 0 returns an empty string; a length greater than the remaining source text extracts through the end.

AI Workflow Generation Notes

  • Position and length are measured in characters. Generate non-negative integers, not decimals or nonnumeric text.
  • Generate only the parameters required by the selected enum values: Start Character Position for From Specified Position, Start Text for From Specified Text, and Extraction Length for Specified Length.