# Nothing getting carried out after setting a variable

**URL:** <https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119>\
**Category:** Questions about Thunkable X\
**Created:** [May 10, 2021, 1:33pm UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119 "2021-05-10T13:33:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 10, 2021, 1:33pm UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/1 "2021-05-10T13:33:38Z")

</div>

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  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/3/b34993a644ffca10d74bd81f19c5cc09c24d8333.png)  
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?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 10, 2021, 1:47pm UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/2 "2021-05-10T13:47:54Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 10, 2021, 3:45pm UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/3 "2021-05-10T15:45:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 10, 2021, 4:07pm UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/4 "2021-05-10T16:07:06Z")

</div>

For stored variables, you need this setup:

```auto
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?

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 10, 2021, 4:29pm UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/5 "2021-05-10T16:29:47Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/e/4e8ba5e80f3b1c95247cd9527a65d77b1fe4acc6.png)  
Still no output…

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 10, 2021, 6:42pm UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/6 "2021-05-10T18:42:44Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 11, 2021, 6:47am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/9 "2021-05-11T06:47:35Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/d/cd57c712bd426c1153102e68039644f306231cb2.png)  
No output in my label.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 11, 2021, 6:49am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/10 "2021-05-11T06:49:41Z")

</div>

Do you have to set the variable twice first to hello and then to label x’s text?

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 11, 2021, 6:50am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/11 "2021-05-11T06:50:28Z")

</div>

Yeah, I do, but that’s just dummy text for testing.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 11, 2021, 6:56am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/13 "2021-05-11T06:56:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 11, 2021, 6:57am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/14 "2021-05-11T06:57:09Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/5/159534fb79320875968c8c61cc2ac62727ea9b6d.png)

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 11, 2021, 7:02am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/15 "2021-05-11T07:02:31Z")

</div>

Oh wait i found your project, don’t worry i am not taking part in the wdc14

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 11, 2021, 7:03am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/16 "2021-05-11T07:03:00Z")

</div>

How did you find my project? I haven’t posted any link!

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 11, 2021, 7:03am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/17 "2021-05-11T07:03:46Z")

</div>

i searched by your username in the public gallery, it was a public project 😁

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 11, 2021, 7:05am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/18 "2021-05-11T07:05:39Z")

</div>

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!\

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 11, 2021, 7:06am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/19 "2021-05-11T07:06:32Z")

</div>

Don’t worry about that, thunkable doesn’t let you see that, not that i won’t to see it either.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 11, 2021, 7:07am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/20 "2021-05-11T07:07:27Z")

</div>

Thunkable doesn’t let you see (what)?

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 11, 2021, 7:09am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/22 "2021-05-11T07:09:20Z")

</div>

Api keys, data from airtable those kind of stuff

Do you really need that if-else because both do the exact same thing.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 11, 2021, 7:10am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/24 "2021-05-11T07:10:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 11, 2021, 7:13am UTC](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119/25 "2021-05-11T07:13:50Z")

</div>

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.

[Next page](https://community.thunkable.com/t/nothing-getting-carried-out-after-setting-a-variable/1274119.md?page=2)
