What I’m asking of you is to help me replace a Code node with an Edit Fields node.
This is the Code node. I wrote it in Python because I know some Python and I know no JavaScript. It edits the ‘content’ key of an RSS feed item with the help of a regular expression.
It works but I kept looking for a neater solution.
Using the replace() method of strings in JavaScript in an Edit Fields node looks neater as well as it lets me familiarize with JavaScript. This is what I came up with:
Looking at the result preview, it seems to be working, but the output pane doesn’t reflect that. What am I doing wrong?
hi there, i think the problem is on the regex pattern, have you made sure that it is the correct regex pattern? because if it is, then the replace function should succesfully replace it with ‘ ‘
The regex syntax could be different between Python and JavaScript, but even then, how do you explain that the preview shows that the regex worked?
can you give me the value that you’ are trying to .replace() so i can see it on my own
owh and also, i notice tht for the field name you are using {{$json.content}} i think you can just write content, because what you want there is the field name and doing {{$json.content}} is giving it the value of the field, not the field name
Thank you so much, that was it!!