Hi
I have a value that I’ve extracted from JSON. Once extracted, it appears to have a trailing /n which is causing me a problem as I need to perform a select query in mysql using this value in a where clause. I’m not getting any results in my query because the value in the database is trimmed.
I’ve added a trim function, but it’s still outputting with the pesky /n and I can’t seem to get rid of it:
Hi @mbuk I’m not too sure without having an exact workflow / test data to work with, but you could try going the regex route and trying something like {{ $json.propertyName.replace(/[\r\n]/gm, '').trim()}} - does that work for you?
@EmeraldHerald annoyingly, you can see in my screenshot on the input side that the value is being returned correctly, but when using this in another node (fro the output side) I can’t seem to be able to trim the whitespace.