Set values lost after HTTP Request

Hi, i’m new to n8n, after playing around with it for a while I noticed the values that are being set using Set Node or Function node are lost after they go through a HTTP Request node.

How do I retain the values that are set before the HTTP Request is called for usage for some other purpose after the HTTP Request is called?

TIA!

Hey @need4eat,

Welcome to the community :sparkling_heart:

You can always refer to the values via the Variable Selector. So, instead of selecting the value from the Current Node, you can select the value from Nodes. Here’s a screenshot:

Here’s the example workflow (you can copy the below code and paste it in your Editor UI!):

Hey Harshil, really appreciate the quick response :slight_smile:

Here’s what i’m trying

image

i’m setting the value like above in a function node…

and then after a couple of other HTTP request and set nodes,

i’m trying to access the above set attribute in a new function node like below

image

but this value is no longer available in items[0].json

Gotcha. In that case, you will have to reference the node. Instead of using items[0].json.customerType you will have to use $node['REFERENCE_NODE'].json.customerType.

That worked! Thank you @harshil1712 :smiley:

1 Like