Skip to main content

Hi All

 

I have a multi-line input that I need to convert or flatten to a single line for use in a different field.  I would need to adda space at least between each line for the output to make sense though. I thought the formatter > Text action would have something, but none of the options seemed to be what I needed.  Any thoughts on how to accomplish this? 

Hi @kstamm - Try using a JavaScript code step. Make sure to pass the text in an input field called “text”.

const text = inputData.text
.split("\n")
.map((line) => line.trim())
.join(" ");

output = p{ text }];

 


Just what I needed, thank you Ikbel!  Those code steps can do a lot if you have the knowledge.