Random one data output

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.

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

1 Like

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

4 Likes

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.

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:

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

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

Thanks. Can you explain what you asked in block?

here’s the tutorial on local-db: Local DB - Thunkable Docs

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.

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

I just answered that here:

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.

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.

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.

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.

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.

?


image

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.

you don’t need screen_opens block
can you show the contents of your local db?

Thank you! I solved!