Hi @Silas_Hundhausen, is there by any chance a line break in your input data? n8n wouldnât show linebreaks in the node details view (to allow viewing more content in a limited space), but it also wouldnât add line breaks.
As a simple counter measure you could try removing linebreaks from your strings by appending something like .replace(/\n/g,'') to your expression (this would replace all linebreaks represented by \n with an empty string).
Oh, the line break would be in your data, not in your n8n expression from the looks of it. So somewhere in the person2 field of your SplitInBatches node.
Maybe you can provide a dummy workflow including some mock data allowing me to reproduce the problem?
Anyway, the .replace() syntax in your screenshot would be wrong as it would search for literal occurrences of /\n and replace these which isnât what you want. Can you try writing your second expression like below so it uses a valid regular expression matching your line break?
Yes, itâs lacking a double quote after person2. Youâd simply need to insert .replace(/\n/g, "") at the end of your existing expression, just before the closing curly braces }}.
So your last name might include another newline character in this case. It would really really help if you could share an example workflow including some mock data using which the problem can be reproduced.
Thatâs probably because .replace() is working with the line break in my example. I suspect in your case there is some other special character in the string youâre trying to modify.
You could also try a broader regular expression, something like .replace(/\r?\n|\r/g, '') found here:
I think i found the error. There was an empty space before the name like " Max". Once I removed the space, it worked again. I will do some more test cases and will get back to you if there is an another error.