# Store a state of a value "flow.set"

**URL:** <https://discourse.nodered.org/t/store-a-state-of-a-value-flow-set/74694>\
**Category:** General\
**Tags:** function-node\
**Created:** [4 February 2023 13:14 UTC](https://discourse.nodered.org/t/store-a-state-of-a-value-flow-set/74694 "2023-02-04T13:14:43Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [4 February 2023 18:46 UTC](https://discourse.nodered.org/t/store-a-state-of-a-value-flow-set/74694/11 "2023-02-04T18:46:53Z")

</div>

Ok the way you have your flow laid out, every message will be going to all four of the 'Valve' function nodes. So if data is for valve 6 + 7, it will also go to 'Valve 1 + 3' and if it doesn't contain msg.Valve30pen, you will get the error.

I'm surprised you haven hit more with all the function nodes.

What does the data look like coning out of the link node? You might be able to add a `switch` node to direct each msg to the right `function` node.

p.s. when posting flows/code on a message, in order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

So use back-tics. You used the single quote mark but I corrected it in your post.

---

_[View the full topic](https://discourse.nodered.org/t/store-a-state-of-a-value-flow-set/74694)._
