Change output key value

I’m extracting stock value with my workflow, however, the key value on the output needs to change because it contains the stock symbol (see below), however, the stock symbol can change so its necessary to change the key value so its more dynamic. How can I do that with a code node?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • **n8n version: 1.8.2
  • Database (Postgres):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system:

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hello @mosog

If I understand you correctly, something like this should do the job

I tried your code but this is what I got.

Now you don’t have body in the node input. Remove the ending .body from the first row of the Code node

1 Like

That worked, thank you for helping me with this. I had tried everything I knew but I still got a lot to learn.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.