Page 1 of 1

Global Variable

Posted: 30 Jan 2014 04:19
by Ankit
Hi,
Sometimes my some of the flows create unnecessary global variables that are of no use to me and infact it hangs my flows.

Is there is a way to delete unnecessary global variables itself.
It should automatically determine which variables are of use and which are not and delete them ..

Please help!!

Re: Global Variable

Posted: 30 Jan 2014 11:53
by kintrupf
Ankit wrote:Hi,
Sometimes my some of the flows create unnecessary global variables that are of no use to me and infact it hangs my flows.

Is there is a way to delete unnecessary global variables itself.
It should automatically determine which variables are of use and which are not and delete them ..

Please help!!
There is no way to determine if a global variable is still in use or not.
But you can add a script action to your flow to remove any unneeded global variables. Just add the following script:

Code: Select all

removeVariable('<global_xxx_1');
removeVariable('<global_xxx'_2);
...
Of course you need to replace "global_xxx_1" with the real name ;-).
Be sure to include the name of the variable in quotes.