# Flow variables troubles

**URL:** <https://discourse.nodered.org/t/flow-variables-troubles/16593>\
**Category:** General\
**Created:** [11 October 2019 08:51 UTC](https://discourse.nodered.org/t/flow-variables-troubles/16593 "2019-10-11T08:51:19Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![jlb](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jlb](https://discourse.nodered.org/u/jlb)\
**Post date:** [15 October 2019 09:57 UTC](https://discourse.nodered.org/t/flow-variables-troubles/16593/22 "2019-10-15T09:57:04Z")

</div>

sorry it was a mistake, the good lines:

> flow.set('tag\_old', const\_nb\_old);  
> flow.set('agv\_old', const\_agv\_old);

So it works well but again when i try to retrieve my values in a mustache template with:

> test={{flow.tab\_agv[1]}};  
> or  
> test={{flow.tab\_agv.1}};

It returns nothing..

> flow.set("tab\_agv["+flow.get("agv\_old")+"]", flow.get("tag\_old"));  
> and  
> essai=[flow.get("tab\_agv["+flow.get("agv\_old")+"]"),flow.get("agv\_old")];

are ok, i get [1,2], [3,5],..etc from essai, so the flow variable seems ok and i thin i've got the good syntax to retrieve it in the template ?

---

<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:** [15 October 2019 10:07 UTC](https://discourse.nodered.org/t/flow-variables-troubles/16593/23 "2019-10-15T10:07:42Z")

</div>

> [@jlb](#):
>
> are ok, i get [1,2], [3,5],..etc from essai, so the flow variable seems ok and i thin i've got the good syntax to retrieve it in the template ?

Are you asking if it works? I thought you already said it worked. I just wanted to be sure you were not double setting the same flow variable,

---

<div class="post-metadata">

**Author:** ![jlb](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jlb](https://discourse.nodered.org/u/jlb)\
**Post date:** [15 October 2019 11:28 UTC](https://discourse.nodered.org/t/flow-variables-troubles/16593/24 "2019-10-15T11:28:37Z")

</div>

My previous example is Ok, no double setting problem, the flow variable "tab\_agv" is well set. I've got the good values in the debug console.

The point now is to retrieve these values from a mustache template with that kind of syntax:

> test={{flow.tab\_agv.1}};

in this example i try to recal the value of

> tab\_agv[1]

But it doesn't work...

---

<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:** [15 October 2019 13:45 UTC](https://discourse.nodered.org/t/flow-variables-troubles/16593/25 "2019-10-15T13:45:58Z")

</div>

are you doing that in a function? template? do you have a small example flow demonstrating the issue?

---

<div class="post-metadata">

**Author:** ![jlb](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jlb](https://discourse.nodered.org/u/jlb)\
**Post date:** [16 October 2019 13:26 UTC](https://discourse.nodered.org/t/flow-variables-troubles/16593/26 "2019-10-16T13:26:19Z")

</div>

Finally that's ok, i found another solution. Thx to all !

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [16 October 2019 13:29 UTC](https://discourse.nodered.org/t/flow-variables-troubles/16593/27 "2019-10-16T13:29:27Z")

</div>

So what was the solution?

If you describe it, the thread becomes useful to someone else finding it in the future…

---

<div class="post-metadata">

**Author:** ![jlb](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jlb](https://discourse.nodered.org/u/jlb)\
**Post date:** [24 October 2019 09:32 UTC](https://discourse.nodered.org/t/flow-variables-troubles/16593/28 "2019-10-24T09:32:18Z")

</div>

i simply declare a var in my webscoket template code:

> var myArray = {};

And i send it through a function call like:

> Draw (myArray);

This function is defined in another template and it works, i get the " myArray" content !

[Previous page](https://discourse.nodered.org/t/flow-variables-troubles/16593.md?page=1)
