HELP : How to pick / select a random line from a CSV table hosted on Google Sheets (drive)

Good morning all,
Hope you are all doing well.

I am contacting you because I need help with an application that I am making as part of a student project.
To put it simply, our goal is to understand the creation of a mobile application. I personally decided to launch myself on an application related to cinema. Overall, my application has 2 main buttons: a button generating a list of the most popular movies of the moment (this list is in the form of a csv table, hosted on my drive). The purpose of the 2nd button is to randomly select one of the films from this list, so that the application can directly choose the film for the user.

Concerning the first button, I managed to set it up. On the form it is not as I expected, but it is functional and it updates when I edit my csv file.

However, I cannot find the solution for the 2nd button: the one that would allow me to randomly select a movie from my list.I would just like that as soon as I click on the button, my application randomly gives me one of the movies in my csv file, in the same form as the first button.
For now, I just copied my different blocks from the 1st button; I tried several blocks with youtube tutorials but none worked.

It would save my life and be great if any of you could help me with this task, which I think would be really easy for the seasoned developer that you are!

Hoping greatly that one of you can help me fastly and thanking you in advance for a response!


Since you want to show only one random item from your global movies list you could use, pick a random item list block from list blocks


Hi dora_paz, thank you very much for your message.

I saw this block, but I admit that i have no a precise idea from where to add it on my blocks.
Should i replace an existing block ? Or should i simply add it, but where ?
Did you think it's possible for you to be a little bit more precise please ? :slight_smile:

Once again thank you for your message!

Where will you use this movie info when you press random movie button in a label or ...?

Yes, I want to use this random pick when i press the Random Movie button!

Try something like this or instead of listview use a label

1 Like

Oh thank you very much, it works with the 2nd solution!

I'm really grateful ! Thank you and have a good day! :smiley:

Have a good day!

1 Like

I believe if you want to continue using listview instead of a label you should change set ListView.Elements block to ListView.ElementsFromString block

1 Like

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