Skip to main content

Trim text

Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

Removes all occurrences of white space characters (such as space, tab, or new line) from the beginning and/or end of an existing text. This command is useful for cleaning up text input that may contain unwanted leading or trailing spaces.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Original text

Enter text or select a variable containing the text to trim

Text or variable

Yes

You can use a variable by clicking the {x} button

Operation

Specify where white space characters will be removed from

from both ends; at the beginning; in the end

Yes

Choose which part of the text to trim

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

Store the trimmed text in a new variable. The output will be the original text with white space characters removed according to the selected operation.


Using Variables in Conditions

You can use the {x} button to insert previously created variables into the "Original text" field. This allows you to process text that was generated or modified by previous actions in your workflow. The output variable can be used in subsequent actions that require text input.


Notes

  • The trim operation only removes white space characters (spaces, tabs, new lines) and not other characters.

  • If the original text doesn't contain any white space at the specified position (beginning, end, or both), the output will be identical to the input.

  • This command is particularly useful when processing user input or data from external sources where extra white spaces might cause issues in subsequent processing.

Did this answer your question?