How to access local storage variable from microflow? - Mendix Forum

How to access local storage variable from microflow?


Greetings, good people.


At one time, I wrote something in local storage, using JavaScript in HTML snippet. Now, i want to access that variable, just to check status of variable in one exclusive split in microflow. Can anyone give me advice how I can do that?


Thank you very much in advance.

4 answers

I went through solution which Lukas told me about (instead of retrieving variable from local storage), and, of course, it was successful.  Solution was very easy: I just created new non persistable entity and everything was solved. :) 


Lukas, thank you very much for instructions.


Best regards.


Hi Branislaw, 

There is a widget that you can use for reading and writing to local storage:

Perhaps this helps.




Nanoflows are run locally on client, so this might be an alternative, however still, you need to read the local storage through a widget. 


Your request seems a bit un-mendix to me. Can't you create a non persistent entity that is associated to the session entity instead of writing and reading the local storage? The HTML snippet does provide an optional on-click microflow event that might help you out here.

If you insist on the local storage you could have a look at the CommunityCommons Module from the app store. It comes with a javascript to HTMLToPlainText. I did not test it but maybe it is possible to use and get the variable from there? Not sure whether or not variables are included in the actions result. I am pretty sure that this is not the best of ideas to do