# How acces flow.set(), flow.get() with var in json

**URL:** <https://discourse.nodered.org/t/how-acces-flow-set-flow-get-with-var-in-json/93837>\
**Category:** General\
**Created:** [11 December 2024 00:29 UTC](https://discourse.nodered.org/t/how-acces-flow-set-flow-get-with-var-in-json/93837 "2024-12-11T00:29:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvain](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@sylvain](https://discourse.nodered.org/u/sylvain)\
**Post date:** [11 December 2024 00:29 UTC](https://discourse.nodered.org/t/how-acces-flow-set-flow-get-with-var-in-json/93837/1 "2024-12-11T00:29:38Z")

</div>

Hi,  
I am problem with var flow.set() and flow.get()  
example of code:

```auto
var tmp ={'start':0,'open':0,'close':0};
flow.set('X1_1',tmp);
flow.set('X2_2',tmp);

```

when I want to write in the variable with flow.set('X1\_1.open',45) , it writes in all the flows X1\_1 but also in X2\_2 which contain open with the value 45.

maybe I must not write the syntax well I am seriously stuck.

Thanks for help.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 December 2024 04:08 UTC](https://discourse.nodered.org/t/how-acces-flow-set-flow-get-with-var-in-json/93837/2 "2024-12-11T04:08:30Z")

</div>

Hi. Read this: [Variables seem linked somehow - #5 by Steve-Mcl](https://discourse.nodered.org/t/variables-seem-linked-somehow/81747/5)

---

<div class="post-metadata">

**Author:** ![sylvain](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@sylvain](https://discourse.nodered.org/u/sylvain)\
**Post date:** [11 December 2024 09:55 UTC](https://discourse.nodered.org/t/how-acces-flow-set-flow-get-with-var-in-json/93837/3 "2024-12-11T09:55:06Z")

</div>

Hi,  
Thanks for reponse.

I'm used

```auto
var tmp={"open":0,"close":1};
flow.set("TEST_1",RED.util.cloneMessage(tmp));
flow.set("TEST_2",RED.util.cloneMessage(tmp));
flow.set("TEST_1.close",10);

```

It's good now.  
Thanks again.

Sylvain

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 December 2024 09:55 UTC](https://discourse.nodered.org/t/how-acces-flow-set-flow-get-with-var-in-json/93837/4 "2024-12-25T09:55:28Z")

</div>

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