How do I insert line breaks into a string?
I have a string formatted as such, "Item1, Item2, Item3, Item4, Item5,...." I would like to replace the commas with line breaks in a flow so that the output looks like:
"Item1
Item2
Item3...."
I can't find a way to input a line break character into the replace text step. Is there any way to do this?
Comments
-
Yes, this is possible!
It's a little bit of a workaround solution, but you're able to get the line break character from the Join Strings With Special Character step. If you pass in two empty strings by building an array with two empty Merge Plain Text inputs, you're able to output a single line break character as shown below:
From here, you can pass the line break character to the replace text step to get your requested functionality:
This is what the inputs/outputs look like for the replace text step:
Documentation:
Join String with Special Character: https://documentation.decisions.com/step-library/docs/join-string-with-special-character
Replace Text: https://documentation.decisions.com/step-library/docs/replace-text
Howdy, Stranger!
Categories
- 4.1K All Categories
- 61 General
- 11 Training
- 201 Installation / Setup
- 1.1K Flows
- 106 Rules
- 260 Administration
- 212 Portal
- 489 General Q & A
- 693 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 51 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 178 Pages
- 5 Process Mining
- New Features
- 178 Datastructures
- 69 Repository
- 219 Integrations
- 28 Multi-Tenant
- 27 SDK
- 76 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 66 Lunch And Learn Questions