Label text change back to initial value

So here is the problem:

  1. I code blocks to change the number lable of “1000000” to the number that is inserted in text input (1500000)

  2. Yes, it works well that the lable changed to “1500000”

  3. BUT, when I press “Back” button and navigate to that page again, the lable changes back to initial value “1000000” like the first picture

The problem is:
I want that the lable stays on with the given number from text input (so it stays 1500000), how can I do that?

Here is the code block to change the price lable

Can someone help me why and how to solve this?

1 Like

If you want the value to still be there when you RESTART the app, you’re going to need to store that value somewhere. A stored variable would be an option if only that user needs the value (be sure to check if it is null), or if you’re going to have firebase or some other backend storing bids anyway (seems logical), you could just grab the value from there when the app starts. But yes, otherwise when the screen starts up again, it’s going to reset your components as they’re built in the designer.

Your screen will also reset if you navigate to another screen and come back. You won’t lose your variable values, but you’ll lose labels that you’ve changed. If you put all your screens in a navigator, that prevents the screens from reloading while the app is still open.

1 Like

Hi @msendiawansmnz9
You should try to save the value in a stored variable only then will it work properly as in a app variable variable is stored only for the time you open the app. Stored variables save it almost forever(unless you do some changes).
So first save in stored variable then show on label