Hi there!
I was very excited about the ‘variables’ announcement, and was hoping that it could simplify the prototypes I’m working on. However, I hit a wall almost immediately, and I’m not sure if it’s because I don’t understand how the feature is meant to work, or if it’s because of a known limitation.
I want to create a ‘switch’ that changes a visual element across multiple screens. For instance, a menu that lets the user change ‘modes’ from ‘online’ to ‘offline’. In my (very limited) programming experience, I would expect to be able to accomplish this by setting a boolean called ‘online’ to TRUE, and then tell each component that if ‘online’=TRUE then display the ‘online’ variant.
However, it does not seem to be possible to display a specific variant based on a boolean state.
The closest I’ve come to making this work is to set a string variable to ‘online’, which changes the variant, but it only does so in one page. If I go to the next page, the ‘state’ is not remembered. (It reverts back to ‘offline’).
So I’m wondering:
– How can I make a specific variant of a component be displayed based on a boolean?
– Are set variables not remembered across pages?