Global variables always retain their values between layouts, unless you specifically reset them.
If you want to assign values to them via text inputs, you will have to add a bunch of events like this:
TextInputA On Text Changed -> VarA set value to TextInputA.text
.
Another option is to use a Dictionary instead of global variables. Then you will be able to optimize these events, for example by storing key name in a local variable on each text input:
TextInput On Text Changed -> Dictionary Set key TextInput.keyname to TextInputA.text