Custom Data Passing between node? 03.31.2017 07:05 AM
1.How can I pass the custom data in an JSON custom object from one node of the same flow to another without ever losing them. For example in this case my need is that I will have an object populated in 1st function and needs to access some properties in subsequent function.
Re: Custom Data Passing between node? 04.25.2017 04:09 PM
You can pass data using a context module. This can be at the node level, to keep local values, or, for the entire flow, you can use a global context. In a function node, you can specify `context.variableName` and that will be available to that node for each deployment of the flow. If you stop the container or make changes and redeploy, the context will be reset.
If you want the data to be available in any of the nodes, use the global context as `context.global.variableName`.
I combined a couple of examples of context variable use from the nodeRed documentation and created a sample (public) flow that you can search for with the name "contextVariables" that shows local (node) and global context use.
Please confirm that you want to flag this content as inappropriate.
Please confirm that you want to delete this content.