How to Use Output Data from Previous Nodes in Your Code

I want to use the output data from 2 or more previous nodes and use it as an input in my code node. As shown, I want to use the timezone value ‘America/Toronto’ in the timezone line in my JS textbox. I tried copying the JSON parameter and other formats, but I couldn’t figure it out. I also checked the documentation about the “$input” parameter and still was not able to make it work. I know this is such a newbie question, but can anyone please help?

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:

@Jorelle_Castillo , you need to remove quotes around the expression as the expression itself produces the string. That is it has to be

{
  . . .
  minute:       'numeric',
  timeZone:     {{ $node["startDate & endDate"].json["timezone"] }},
  timeZoneName: 'short'
}

Your timezone becomes invalid because of that when the options applied at the line 19.