# Issue with function not returning a statement

**URL:** https://community.thunkable.com/t/issue-with-function-not-returning-a-statement/1648431
**Category:** Questions about Thunkable X
**Tags:** beginner, list
**Created:** [December 7, 2021, 5:17am UTC](https://community.thunkable.com/t/issue-with-function-not-returning-a-statement/1648431 "2021-12-07T05:17:52Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dalasernakoqnu](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@dalasernakoqnu](https://community.thunkable.com/u/dalasernakoqnu)
#### Post date: [December 7, 2021, 5:17am UTC](https://community.thunkable.com/t/issue-with-function-not-returning-a-statement/1648431/1 "2021-12-07T05:17:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/0/305c6bf9c6c5e760b1df1608bc30489f8ae3e6f3.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/3/03010bb5afdaedc7e28fd512d3c89f0b5f890412.png)

Hi, I’m having an issue where in the if/do statement “if ButtonSelection1’s disabled…” it doesn’t return the list to appear in the label’s text. But in the if/do statement above it, “if Button Selection 2’s disabled…” it returns the list as I wanted it to.

i.e. I click ButtonSelection1 then ButtonNext2, it’ll return the list of texts that I’ve previously inputted. But if I click ButtonSelection2 then ButtonNext2, it’ll return as “undefined”.

---

<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: [December 7, 2021, 5:34am UTC](https://community.thunkable.com/t/issue-with-function-not-returning-a-statement/1648431/2 "2021-12-07T05:34:56Z")

</div>

Can you share a link to the project? I’m guessing you’ve initialized/set the value of `Narration2 Selection2` to something other than a list elsewhere in your project. Or else there isn’t a list item at `narration index` for that list. But it’s hard to tell without seeing the full context.

---

<div class="post-metadata">

### Author: ![dalasernakoqnu](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@dalasernakoqnu](https://community.thunkable.com/u/dalasernakoqnu)
#### Post date: [December 7, 2021, 3:55pm UTC](https://community.thunkable.com/t/issue-with-function-not-returning-a-statement/1648431/3 "2021-12-07T15:55:13Z")

</div>

[https://x.thunkable.com/copy/d8e3acb13873885ca3ce21b99ec6bf20](https://x.thunkable.com/copy/d8e3acb13873885ca3ce21b99ec6bf20)

Does this work?

---

<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: [December 7, 2021, 5:00pm UTC](https://community.thunkable.com/t/issue-with-function-not-returning-a-statement/1648431/4 "2021-12-07T17:00:17Z")

</div>

Yes but I’m pretty confused. In that project, the buttons you mention are hidden and/or disabled. Can you send me a link that has everything set up the way you intend it?

---

<div class="post-metadata">

### Author: ![dalasernakoqnu](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@dalasernakoqnu](https://community.thunkable.com/u/dalasernakoqnu)
#### Post date: [December 8, 2021, 2:33am UTC](https://community.thunkable.com/t/issue-with-function-not-returning-a-statement/1648431/5 "2021-12-08T02:33:31Z")

</div>

[https://x.thunkable.com/copy/e6e3b37ede1ec249ae19df796a2c8edf](https://x.thunkable.com/copy/e6e3b37ede1ec249ae19df796a2c8edf)

Hopefully this makes more sense, I organized it and made some changes but its still similar to my current issue where if I click Button Selection 2, it doesn’t return the list “Narration2 Selection2”.

---

<div class="post-metadata">

### Author: ![dalasernakoqnu](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@dalasernakoqnu](https://community.thunkable.com/u/dalasernakoqnu)
#### Post date: [December 8, 2021, 2:35am UTC](https://community.thunkable.com/t/issue-with-function-not-returning-a-statement/1648431/6 "2021-12-08T02:35:59Z")

</div>

I realized where my mistake was and everything’s working as I’d like it to. Thank you for offering help!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [March 8, 2022, 2:36am UTC](https://community.thunkable.com/t/issue-with-function-not-returning-a-statement/1648431/7 "2022-03-08T02:36:10Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
