There’s a good post about scoping here:
If you want global variables, I think you have to use something like Variables+History: