When I move a block before setting a variable to a value, it works, but if I put it after the set variable block, it never carries out.
For example:
Using
I am not getting anything in Label1, but when my code is
Uploading: image.png…
I see hello in my label. Is this a bug?
1 Like
Stored variables are tricky, if the update of the stored variable fails nothing after if is executed. There is something in your code preventing the stored variable to update. It could be something like you have set it to empty list
so it will not accept a text value,
2 Likes
It’s a stored variable so it is automatically initialized to null, I suppose. This is the first time I am changing its value. This is for the WDC, so I’m pretty sure that since many people will be working on apps now, it can’t be a bug or they’d have reported it too.
@domhnallohanlon Any ideas?
For stored variables, you need this setup:
When screen opens
If stored variable = null
set stored variable to [value]
Where [value] is an empty string ("") or an empty list or zero (0).
If you’ve already done that, which [value] did you set it to?
3 Likes
@codeswept it seems your stored variable is currently saving a value type that will not accept to change to another type. It will not help testing for null because it’s not null anyway.
To force the stored variable to change type first assign null to it, wait a second then assign a text value.
[Edit]
Even better, change the variable name and treat it as a new stored variable and check for null and assign the correct value.
2 Likes
Thanks for the help! Will try that
@muneer I don’t know how to thank you! I was getting worried over this variable and I thought that all stored variables would behave this way… I changed the name of my variable and now I’m receiving hello in my label. Thanks once again!
Oh no! It’s back to not working…
It was working earlier, but now it’s not.
No output in my label.
1 Like
Do you have to set the variable twice first to hello and then to label x’s text?
1 Like
Yeah, I do, but that’s just dummy text for testing.
Oh makes sense, ill check out your project and get back to you.
I couldn’t quite find it, could you give me the link?
1 Like
Oh, I’m really sorry, but I don’t think I’ll be able to share the link yet. The code that I’m having trouble with is:
Oh wait i found your project, don’t worry i am not taking part in the wdc14
1 Like
How did you find my project? I haven’t posted any link!
i searched by your username in the public gallery, it was a public project
Oh, that’s because I’m not PRO. Please just go through that project for now, and don’t open any others under my account, because I have a lot of personal information and API keys, etc, in all my projects, so I am not at all comfortable with sharing some projects. Please bear this in mind. Thanks!\
Don’t worry about that, thunkable doesn’t let you see that, not that i won’t to see it either.
1 Like
Thunkable doesn’t let you see (what)?
Api keys, data from airtable those kind of stuff
Do you really need that if-else because both do the exact same thing.
Well, it’s not just that. Just a request: since you have already found my project, please go through it and tell me if I have done anything wrong. But please do not open any of my other projects.
Yes, I do need it. I am just setting my variables to the same dummy text, as I have stated earlier.
And if i am not wrong you would want to set a button with a tick to nothing and without a tick to something, so there is an error there and while testing i did get the label to show label for 50 words.
1 Like