Flows global variable issue

Wappler Version : 2.8.4
Operating System : Mac OSX Catalina v10.15.3

Same issue in both inline-flows & page-flows.

I tried setting a global variable by data binding it to a variable, the binding doesn’t persists when I check the generated code.

The UI puts something like this and when I save it, no binding is saved

[[{"id":"var_test1.value","title":"var_test1.value","value":"var_test1‥","class":"longfield"}]]

Such data binding issue might happen with other actions as well in the flow - here is a related bug Inline-flow: RunJS - data binding & closing single quote issues

Could you please enable experimental features and test again to see if it works then?

Enabling experimental features helped. The binding is persisting correctly.

That is interesting…

What is Set Global supposed to do… Set the value of a variable outside of the flow?

I’ve never used that… I’ve always used the Run command to set external variables.

I guess the difference is that Set Global will set it synchronously, so it it guaranteed to be set before the next command in the flow.

@Antony
Same as global variables in general programming…

At the moment variables have confined scope based on where in the dom they are defined & initialised… in browser console or javascript, you access it as dmx.app.data.accordion1.row1.column2.var_local

My understanding is the global variable will be at the dmx root level… in browser console or javascript, you can access it as dmx.global.data.var_global… In the app structure global variable should be accessible from everywhere…