# Random one data output

**URL:** <https://community.thunkable.com/t/random-one-data-output/1664364>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [January 3, 2022, 6:28am UTC](https://community.thunkable.com/t/random-one-data-output/1664364 "2022-01-03T06:28:27Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![suko1857r6rth](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@suko1857r6rth](https://community.thunkable.com/u/suko1857r6rth)\
**Post date:** [January 3, 2022, 6:28am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/1 "2022-01-03T06:28:27Z")

</div>

When the screen is opened among the data from 1 to 100, / it is hoped that ‘one data (1 to 100) will be automatically selected and output randomly’. I’m trying with a spreadsheet, but it doesn’t work. Help me.

> [@\[Solved\] How to Choose random User from database (For giveaway)](https://community.thunkable.com/t/solved-how-to-choose-random-user-from-database-for-giveaway/322285/6):
>
> Yeah by @Sofia

I’m referring to this, but there’s no  
" in Local\_DB1 call GetCell ~~"

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [January 3, 2022, 8:42am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/2 "2022-01-03T08:42:16Z")

</div>

you can obtain a list of all values of a specific column in your local database.  
then use the random\_item\_of\_list block to get a random object from that list

---

<div class="post-metadata">

**Author:** ![suko1857r6rth](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@suko1857r6rth](https://community.thunkable.com/u/suko1857r6rth)\
**Post date:** [January 4, 2022, 2:41am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/3 "2022-01-04T02:41:23Z")

</div>

I’m a beginner, so I can’t understand.  
Specifically, how do I do it?

I did this, and the entire data comes out.  
It’s hard to get just one.

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

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [January 4, 2022, 2:56am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/4 "2022-01-04T02:56:37Z")

</div>

go to youtube and search for thunkable tutorial. start with the short introductory ones.

if you’re a beginner - you’ll also find everything you need to know as a beginner from the thunkable site:

> **[Welcome to Thunkable](https://docs.thunkable.com/)**
>
> The platform where anyone can build their own mobile apps.

i suggest you use a local db (instead of spreadsheet) for storing your giveaway objects for now.

---

<div class="post-metadata">

**Author:** ![suko1857r6rth](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@suko1857r6rth](https://community.thunkable.com/u/suko1857r6rth)\
**Post date:** [January 4, 2022, 3:10am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/5 "2022-01-04T03:10:30Z")

</div>

How do you make local dB?  
Can I make it local even if I have a lot of data?

---

<div class="post-metadata">

**Author:** ![suko1857r6rth](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@suko1857r6rth](https://community.thunkable.com/u/suko1857r6rth)\
**Post date:** [January 4, 2022, 3:18am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/6 "2022-01-04T03:18:45Z")

</div>

Thanks. Can you explain what you asked in block?

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [January 4, 2022, 3:21am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/7 "2022-01-04T03:21:18Z")

</div>

here’s the tutorial on local-db: [Local DB - Thunkable Docs](https://docs.thunkable.com/local-db)

if your data is static then you can use local-db. however, i believe changes you make to it are not retained so that next time you run your app you start with the intially defined database. if your data is more dynamic then you need to consider using spreadsheet or airbase or firebase, etc. but be prepared to spend some time on the learning curve.

---

<div class="post-metadata">

**Author:** ![suko1857r6rth](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@suko1857r6rth](https://community.thunkable.com/u/suko1857r6rth)\
**Post date:** [January 4, 2022, 7:15am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/8 "2022-01-04T07:15:10Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/4/04dbfb351f265dd7db02190f814535afe255c22c.png)

" in Local\_DB1 call GetCell ~~" “IN~~~ CALL”  
===\> I’m using a local DB, but where is this block?

---

<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:** [January 4, 2022, 7:39am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/9 "2022-01-04T07:39:35Z")

</div>

I just answered that here:

> [@\[Solved\] How to Choose random User from database (For giveaway)](https://community.thunkable.com/t/solved-how-to-choose-random-user-from-database-for-giveaway/322285/10):
>
> It’s a Data Source block. See this: It’s going to look a little different because this topic is two years old and some of the blocks have changed.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [January 4, 2022, 8:16am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/10 "2022-01-04T08:16:35Z")

</div>

if you read carefully, this block is taking ONE random item from a **LIST** (which has two slots - the first is a LIST of the answer thjnkable blah blah, the 2nd slot is unused) so the **LIST** really has only one item. now you’re taking one random item from a list containing one item so you will always get that item - but that item happens to contains a handful of values! that’s why you’re getting the results you describe.

detach the list block with 2 slots from the set text command and reattach the ‘list of values …’ and you should be ok.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [January 4, 2022, 8:29am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/11 "2022-01-04T08:29:46Z")

</div>

why don’t you create a local db of 5+ items, create a screen with a button and label then

1. go to the data sources gallery and see if there’s a block that returns the list of values of any column
2. go to list gallery to see if there’s a block that gets a random element of a list  
then put those two blocks together to build your label’s text and put them inside a when-button-click block.

---

<div class="post-metadata">

**Author:** ![suko1857r6rth](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@suko1857r6rth](https://community.thunkable.com/u/suko1857r6rth)\
**Post date:** [January 4, 2022, 8:49am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/12 "2022-01-04T08:49:26Z")

</div>

I’m sorry, but if you’re a human, not ai,can you show me with a block image? Thank you so much for your help, but I don’t know English at all, and I don’t understand you at all because I’m a beginner.

---

<div class="post-metadata">

**Author:** ![suko1857r6rth](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@suko1857r6rth](https://community.thunkable.com/u/suko1857r6rth)\
**Post date:** [January 4, 2022, 8:50am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/13 "2022-01-04T08:50:22Z")

</div>

If I have only 1 to 100 pieces of data, I only need to expose one randomly.  
However, the problem is that all 1 to 100 data are exposed.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [January 4, 2022, 8:53am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/14 "2022-01-04T08:53:28Z")

</div>

you haven’t even opened thunkable even just to add a screen, a label and a button! show us a picture of what you’ve tried.

---

<div class="post-metadata">

**Author:** ![suko1857r6rth](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@suko1857r6rth](https://community.thunkable.com/u/suko1857r6rth)\
**Post date:** [January 4, 2022, 8:56am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/15 "2022-01-04T08:56:17Z")

</div>

?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/5/8595e182b1026a70d0548bf11267f293a9aa9635.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/8/381db815e1c63f489cef8ffd4015b3e06a78f96d.png)

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [January 4, 2022, 8:58am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/16 "2022-01-04T08:58:06Z")

</div>

> [@manyone](#):
>
> if you read carefully, this block is taking ONE random item from a **LIST** (which has two slots - the first is a LIST of the answer thjnkable blah blah, the 2nd slot is unused) so the **LIST** really has only one item. now you’re taking one random item from a list containing one item so you will always get that item - but that item happens to contains a handful of values! that’s why you’re getting the results you describe.
> 
> detach the list block with 2 slots from the set text command and reattach the ‘list of values …’ and you should be ok.

THIS IS WHY YOU GET ALL OF THEM:  
if you read carefully, this block is taking ONE random item from a **LIST** (which has two slots - the first is a LIST of the answer thjnkable blah blah, the 2nd slot is unused) so the **LIST** really has only one item. now you’re taking one random item from a list containing one item so you will always get that item - but that item happens to contains a handful of values! that’s why you’re getting the results you describe.

detach the list block with 2 slots from the set text command and reattach the ‘list of values …’ and you should be ok.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/6/f6f701768d4cc0fcb2c28e9d2c13ed27e27e2f32.png)

you don’t need screen\_opens block  
can you show the contents of your local db?

---

<div class="post-metadata">

**Author:** ![suko1857r6rth](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@suko1857r6rth](https://community.thunkable.com/u/suko1857r6rth)\
**Post date:** [January 5, 2022, 3:35am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/17 "2022-01-05T03:35:20Z")

</div>

Thank you! I solved!

---

<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:** [April 5, 2022, 3:35am UTC](https://community.thunkable.com/t/random-one-data-output/1664364/18 "2022-04-05T03:35:40Z")

</div>

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