Hi Thunkable
We are a group of students using Thunkable for the first time, working on a Technovation project. When we do “Initialize Stored Variable” the variable is not getting Initialized to null. I am getting FMudTgnMkXOkKcNih1a5dXUTZyB2 and one of my partner is getting hAVRzCbuBZOqEi4UJT8jtDHCLot2 however another partner is getting null. Our mentor in US is also getting null. Please help us out. All of us are having free version of Thunkable.

.
In the Text_Input1 I am getting the above mentioned Garbage value.
Regards
Hello @charankajed57wmx, welcome to Thunkable! 
Here is a correct way to initialize a stored variable:
Be sure to check out How to ask Great Questions v2.0, the Community Guidelines, and our Getting Started Guide to make the best of your Thunkable Community experience!
Hi @ioannis,
I am there Mentor. I wanted them to get used to filing issues hence asked the student to file it. Thanks for the solution but it will not work in this case because UserId has garbage in it.
This code you see, is from the sample code Thunkable provides for creating Login
The same code works for some does not work for some.
The only workaround I see create another stored variable called as OldUser and set it to FALSE. When the new user is created set OldUser = TRUE. So when we come to the blocks where we are running into issue, we do If (OldUser == TRUE) then we don’t have to worry about the Stored Variable initialization bug.
If the stored variable was set up incorrectly initially, it will keep that value until changed. To reset it, you can simply run code that says:
When screen opens, set stored variable UserId to [null]
Then, after that project has been previewed once, remove that code and use the blocks that @ioannis suggested. You’ll need to update these blocks to check for a null value and set an initial value:
Because as those blocks appear in the project you linked to, they will not correctly initialize a stored variable.
1 Like
It depends if this is your starting screen. Setting your text input to the variable when it’s already null
isn’t ideal. But if it is, try checking if it not equal to an empty string (""
). And probably try using strings instead of both logic and string blocks.
Also actually I don’t think it’s a good idea to use real names or location in the community unless it’s on your profile. Someone confirm this?
Thank you all for helping me out. What @tatiang said worked perfectly well. So there is an issue with Stored Variable Initialization in Thunkable. With @tatiang 's fix everything worked. Thank you very much.
@krish05 Thank you for your advise. I am going to delete our personal information. Sorry for that.
2 Likes