Uipath doesn't see new lines when copying text from excel cell to textbox

Hi there!

I’m currently struggling to copy different text cells from a document to a textbox on a website.

Although most of the script works correctly, I have one problem with the excel enters/new lines.

I used the string “text” to define what’s been read inside the cell, and then asked uipath to type into the textbox on a website the “text” string.

Let’s say text is equal to

Me and my friends were walking in the woods
And we heard a loud bang

Uipath transforms it to

Me and my friends were walking in the woodsAnd we heard a loud bang

Is there anything I can do about this?

Thanks alot!

Hi, replace new lines with spaces. Try excelText.replace(Environment.Newline," ").

Hope this would help you
If
In_text = “Me and my friends were walking in the woods
And we heard a loud bang”
Then

To make it a single line
Out_text = String.Join(“ “,In_text.Split(Environment.Newline.ToArray()))

This will make all as a single line

Cheers @Josh_Teller