Flow set variable not retained

I have a flow which sets a global variable, and the flow gets triggered by a cronjob.
Outside the editor i.e. in the normal usage of the phone, the flow does get triggered according to the time set, and the variable does change. However, if I open the editor, the value of the global variable gets reverted to the previous value, which was set while I was editing the preset.

To summarize, if a global variable is updated using flows, it’s value does not get updated in the editor, and hence on opening the editor, the previous value gets set.

Can you set the Store mode of the Set Global Var action to “Write file” and see if that makes a difference?

Hi there,

As far as I know, the value of a global variable will be preserved every time we save/export preset as a file. And every time we open the preset in the editor, the global variable will contain whatever values it was previously saved in the preset file.

I hope this would help.
:smiling_face::+1:

I can reproduce this behavior as well. However, the variable retains its correct state during runtime.

This is “by design” currently. A global is not persistent to preset reloads, if you reload a preset on screen or on the editor the global will return to its saved state (so the state the editor saved it to).

I am planning to add a persistency layer to flows or maybe a way to persist globals with a flag but right now there is not way to do this unless you use a flow and write/read from a file every time you need to set a value.

2 Likes

Alright, thank you. For now, I figured out another workaround for now that doesn’t involve flows.

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