Strip extra spaces
The "Strip extra spaces" robot cleans whitespace off a string in Bitrix24 (Alaio) business processes and robots: at both edges, only at the start, or only at the end, and with the flag on it also collapses repeated inner spaces into one. It understands non-breaking spaces from pasted text. It returns the cleaned string and its length.
The robot removes the invisible junk from strings — edge spaces and doubled inner spaces break comparisons in conditions, duplicate search, and document merges. The input is the string, the cleaning spot (both — both sides, start — leading only, end — trailing only), and the Collapse repeated inner spaces flag. Besides regular spaces it strips tabs, edge line breaks, and non-breaking spaces that often arrive with text pasted from documents. Typical use cases: clean a full name before matching it against an existing contact; drop the trailing space from a copied contract number; tidy text before writing it to a field. It returns the result and its length — compare the length with the original to tell whether there was junk.
What input parameters does the robot accept?
| Parameter | Type | Required? | Default |
|---|---|---|---|
| Source string | text | yes | |
| Where to clean: both — both sides, start — leading, end — trailing (default both) | string | — | |
| Collapse repeated inner spaces (Y/N, default N) | string | — |
What does the robot return?
| Parameter | Type |
|---|---|
| Result | text |
| Result length | int |
Scenario: cleaning a contract number
- A manager pastes a contract number with a stray trailing space
- The robot strips the whitespace off the string edges
- The clean number is written to the deal field and the lookup finds the document