I am trying to persist some stored variables by setting and getting them, but for some reason I keep getting a null value returned. I have followed a few threads and tried to replicate this but cannot seem to get the value.
The screen is not the main screen so it opens once I click on a button to go there, not sure if that makes any difference and it’s null on my android and pc test.
I also tried a text value incase it did not like a Boolean.
You need to stop using the set stored variable " " block.
That block is for dynamic variable names. So when you put the stored variable test_sr_gm block in where the variable name should be, you’re telling Thunkable to get the value of a variable with the value from the stored variable. So let’s say that stored variable test_sr_gm has the value “43”. Your blocks would be attempting to reference a stored variable called 43. But that doesn’t exist so you see “null”.
Instead, use the set variable block at the top of the variables drawer.
Thanks for responding to my query. Sorry but I am completely confused by that. I am not sure then how I would actually set a default value if it does not exist. I am still learning on the whole block config.
I tried this, but that did not work either.
I then put the set variable at the top of the block, but that was the same.