Joining strings with line breaks
Comments
-
Hello All,
I have a list of strings from that I need joined together into one string, separating each individual strings either by a new line, or a tab character. Is it possible for me to do this in Decisions?
-
Hello Samuel,
A possible solution would be using a custom merge step, along with a forEach step. The custom merge step, also known as the NVelocity step, allows us to define a template that can be used to help us define a structure for a string. Since the template respects line breaks, we can use this as a way to merge the strings together, separating each with a new line.
To use the NVelocity step, we would need to create the template, along with adding any variables, which will become inputs needed for the step. Below is an example template which defines two strings that will be used by the step.
[img]https://lh4.googleusercontent.com/syFojLU5F3FQgByWX-GWxdkyeHE_mZR_WMEXplBS1GFOY9aOl-ujXpW8aBk0C62HUrGo8I98CcttxwTPWbrsqgRcWigCt5zknFDpUFunoA3FftDcWleL6ZRqAGGs7oDsPaIUPVhO[/img]If the step is configured correctly, the resulting string will retain the formatting defined by the template. Below is an example output from the step, along with how the string will be displayed on a form.
[img]https://lh5.googleusercontent.com/HEYPN6ZlqXRmHXZ6-6JrBTXJKuh9ZEMh1ToKL5ymZWHjXL_oROkXrDePQoYhVLDlJfdVbwA3mFzPbi7Dc9oijiBqGRBHxX_zM2VctYJbMK2Ae1A2uF6HZ-bphaCJw9ghPJ7_2Ohm[/img]
[img]https://lh3.googleusercontent.com/Hw_14WekbDxnwTeOa_MfRM-lTjIeR2NFjQyX_9mTKNNxiNXQD5emxeAMh2f1SVTjdlCY-yRAvmVzxWWDoQMBn4M3eINKHc4OAB2hTGIrX-5tz0uGy_QiqmJ3GfsD9VC1INx5ATQH[/img]
Howdy, Stranger!
Categories
- 4.2K All Categories
- 67 General
- 11 Training
- 202 Installation / Setup
- 1.1K Flows
- 106 Rules
- 262 Administration
- 212 Portal
- 490 General Q & A
- 695 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 52 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 179 Pages
- 5 Process Mining
- New Features
- 179 Datastructures
- 69 Repository
- 221 Integrations
- 28 Multi-Tenant
- 27 SDK
- 78 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 83 Lunch And Learn Questions