pageVariable not set to initial Value, when opening page second time
complete
F
Felix
The pageVariable is supposed to be set to its 'initial Value' every time the page is opened. But the pageVariable is only set the first time. When the user changes the page and returns to to page later, the pageVariable still keeps the value from the past. This results in unexpected behaviour of the app.

Log In
T
Timo Kapanen
complete
Promptly response provided
K
Kirill Leventcov
in progress
K
Kirill Leventcov
Hi,
The 'Initial value' is a value given to a variable before any modifications. Meaning, that if any changes are applied, the initial value is permanently overwritten until the app restart. You can set the page variable to its initial values by using the 'Page mounted' logic event and 'Set page variable' flow function.
F
Felix
Kirill Leventcov: Hi Kirill, if the current behaviour is meant to stay as permanent, I have two comments:
1) the behaviour is not consistent for all pageVariables. There are other variables (e.g. pageVariables that I use to control the visibility of components), that reset back to their initial values every time.
2) your suggestion to use the 'Page mounted' logic event is without doubt very practical and easy to do. Then the problem lies in the misunderstanding about the 'initial value'. The inconsistent behaviour (see 1) makes it even harder to know, that the 'Page mounted' logic should be used.
A very easy countermeasure could be, to add an 'info' next to 'initial Value' with the very same text like in your previous post (like next to the 'variable name' label).


K
Kirill Leventcov
Felix:
> add an 'info' next to 'initial Value'
Great suggestion! I will add that to our development pipeline.
Furthermore, I did some testing and figured out that the pageVariable does indeed reset to the initial value when navigating back, or opening the page via logic. I am not sure if that is intended behavior, as the definition of initial value has been as I described previously. I will investigate that with the development team and get back to you as soon as I find out.
Update: A page variable only exists in the context of a page that is open. If the page is closed and reopened, the page variable gets initialized again, thus taking the 'Initial Value'. Hope that answers your question.