I am trying to replace a string within the Edit Fields node with another string.
Issue is that it doesn’t seem to replace the original string with the new string…
The Json is below any ideas what simple thing I am doing wrong
{{ $json["Location"].replaceAll('EUROMASTERGBA161 BRIGHTON WEST (EX PORTSLADE)-8M','A161 BRIGHTON WEST (EX PORTSLADE)') }}
If I understand you correctly, the string I want to replace is EUROMASTERGBA161 BRIGHTON WEST (EX PORTSLADE)-8M
I want to replace it with
A161 BRIGHTON WEST (EX PORTSLADE)
I mean what was the original string (the one, in which you are trying to replace part of it, not the replacement part itself)? If it has only the content that you have specified, then you don’t need the replace function.
The function targetString.replaceAll("replace me", "replaced content") will replace all occurrences of the substring replace me with the new one replaced content in the string targetString.
E.g. if the targetString is:
some text with *replace me* words that you may see twice
*replace me* on the other line too
then it will be changed to
some text with *replaced content* words that you may see twice
*replaced content* on the other line too
Thank-you for the reply, I thought it was something stupid I was doing.
Instead of double quotes I was inserting single quotes and then not giving the manual mapping a name of the column.