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.3K All Categories
- 69 General
- 11 Training
- 206 Installation / Setup
- 1.1K Flows
- 108 Rules
- 266 Administration
- 212 Portal
- 495 General Q & A
- 704 Forms
- 335 Reports
- 3 Designer Extensions
- 47 Example Flows
- 56 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 184 Pages
- 5 Process Mining
- New Features
- 181 Datastructures
- 69 Repository
- 227 Integrations
- 28 Multi-Tenant
- 27 SDK
- 81 Modules
- 57 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 112 Lunch And Learn Questions