# How to get a random text to be pulled out of a data source, then displayed on the screen

**URL:** <https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524>\
**Category:** Questions about Thunkable X\
**Created:** [October 6, 2022, 7:25am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524 "2022-10-06T07:25:37Z")\
**Posts on this page:** 14\
**Page:** 3

<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:** [October 10, 2022, 2:06pm UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/44 "2022-10-10T14:06:42Z")

</div>

This needs to be `random row num`:

 ![Image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/67cb547346a6d0d447e94216d496528dfa1800fa.jpeg)

---

<div class="post-metadata">

**Author:** ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)\
**Post date:** [October 11, 2022, 7:05am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/45 "2022-10-11T07:05:37Z")

</div>

What Should I like that variable to be? , Should " app variable random row num" be connected to my data source somehow, or should I just leave it how it is?

---

<div class="post-metadata">

**Author:** ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)\
**Post date:** [October 11, 2022, 7:44am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/46 "2022-10-11T07:44:34Z")

</div>

Should I do something like this:

 ![Screen Shot 2022-10-11 at 5.43.59 pm](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/9/a99c11cd987cb7fa408c5e3a854446b5feee55e1.png)

---

<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:** [October 11, 2022, 7:53am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/47 "2022-10-11T07:53:30Z")

</div>

Please take a careful look at the screenshot I provided. Because you’ve recreated it incorrectly twice now and I can’t really keep spending all this time helping you compare screenshots. You can do that. This is the screenshot I’m referring to:

> [@How to get a random text to be pulled out of a data source, then displayed on the screen](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/40):
>
> Try this:

I also mentioned this earlier:

> [@tatiang](#):
>
> You need to ignore the `random item` block.

Do not use that block!

---

<div class="post-metadata">

**Author:** ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)\
**Post date:** [October 11, 2022, 8:04am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/48 "2022-10-11T08:04:18Z")

</div>

I Have it exactly the same now, I will see if it works. Thanks For your help. 🙂

---

<div class="post-metadata">

**Author:** ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)\
**Post date:** [October 11, 2022, 8:33am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/49 "2022-10-11T08:33:11Z")

</div>

It works but after 20 times it says “undefined”. I am assuming this is because it has gone though all the challenges which is what I want, but how could I add a reset button so that the user could continue to do them, or should I just make the list of challenges longer?

---

<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:** [October 11, 2022, 2:32pm UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/50 "2022-10-11T14:32:39Z")

</div>

You will need to check if the length of `app variable Challenges` is zero. If it is, then all of the challenges have been used up. To reset, use this block which is already part of your `when screen Opens` event:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/c/bcf38b4e767dd41ee9343bd81e1c4530ce8cef59.png)

---

<div class="post-metadata">

**Author:** ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)\
**Post date:** [October 12, 2022, 8:01am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/51 "2022-10-12T08:01:31Z")

</div>

![Screen Shot 2022-10-12 at 6.00.18 pm](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/9/0906f78e7df38b7640f6195eb0be0f3bd266a6af.png)

Sorry that I am sending you a screenshot but is this correct? 🙂

I appreciate your help, Many Thanks, Levi.

---

<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:** [October 12, 2022, 2:28pm UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/52 "2022-10-12T14:28:21Z")

</div>

Part of knowing if something is correct is looking at the expected outcome vs. the actual outcome.

1. What are you expecting those blocks to do?

2. What actually happens when you preview them?

3. And how closely do your blocks compare to what I described?

---

<div class="post-metadata">

**Author:** ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)\
**Post date:** [October 13, 2022, 7:50am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/53 "2022-10-13T07:50:48Z")

</div>

1. What are you expecting those blocks to do?  
I am expecting the blocks to make the challenges reset so that you can reset it.
2. What actually happens when you preview them?  
The App Says your blocks don’t function.
3. And how closely do your blocks compare to what I described?  
They are sound similar, but I can’t find halve of the blocks you described.

---

<div class="post-metadata">

**Author:** ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)\
**Post date:** [October 13, 2022, 8:12am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/54 "2022-10-13T08:12:47Z")

</div>

Or Like a “get more challenges” button of some sort.

---

<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:** [October 13, 2022, 3:23pm UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/55 "2022-10-13T15:23:41Z")

</div>

Your blocks check to see if a variable is equal to one. But I suggested that you check the _length_ of a variable and see if it’s equal to zero. So those are two different things.

Can you post a screenshot of the “your blocks don’t function” message?

All of the blocks I’ve mentioned are blocks that you added to other screenshots you’ve shared above.

I’m sorry you’re having a hard time finding those blocks but maybe it would be helpful to have someone walk you through all of this over Zoom. If you’re interested, you can send me a private message and we can discuss what I charge for that service.

---

<div class="post-metadata">

**Author:** ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)\
**Post date:** [October 14, 2022, 7:18am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/56 "2022-10-14T07:18:00Z")

</div>

I might use your service later, but here I just need help with this one part of the app I am working on, once I sort this out I can work on more important stuff.

---

<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:** [January 12, 2023, 7:18am UTC](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524/57 "2023-01-12T07:18:31Z")

</div>

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

[Previous page](https://community.thunkable.com/t/how-to-get-a-random-text-to-be-pulled-out-of-a-data-source-then-displayed-on-the-screen/2071524.md?page=2)
