How to display text in column corresponding to first column

Good evening Thunkers! :wave:t2:

My app streams audio files from a thunkable database list. Each time the audio is played, it is removed from the list and then when everything on the list has been played, it automatically refreshes the list and starts again, all music is always in a shuffled order. :grinning:

GOAL: To display the title of each audio file being played.

“Trackfiles” is the first column. This houses my audio URLs to stream.

I added a text label called “displaytext” to call the text written in the 2nd column (also called “displaytext”) of this database.

When I tested it, it displays all of the columns at once like: “text1, text2, text3… etc”.

I need one row at a time, the same row as the audio file being streamed.

I hope I am explaining this well! I will add a screenshot of my work so far to give more context.

Thank you so much in advance for your advice! I really appreciate it. It’s becoming very complex for me, as I am definitely a beginner! :sweat_smile:

Can anyone advise how to use the database columns correctly?
Attaching column 2 to the corresponding row in column 1 to show the title of the streaming audio track?

I’d really appreciate your help!

Many thanks Thunkers! :sweat_smile:

The variable displaytext is a list and you should use it the same way you use the variable tracks.

To accomplish what you want, first change the order of blocks in the screen open event. The loading of columns to displaytext comes first then the function “set track”

Inside the function “set track” you need first use a variable to store the random number. Now, you are using it directly in variable thistrack.

You need to use the same random number to choose the track and to display the track title in the same way.

You will also need to refresh the list displaytext in the function “reset” the same way you refresh the list tracks.

Hope this helps

1 Like

:wave:t2: Hi Muneer! Thank you so much for your advice! I believe that I understand the rest of your suggestions above, and what you’ve said here makes sense in my mind - however applying it in the blocks is confusing me a little… :grimacing:

Would you mind possibly sharing an example of blocks to convey this?

Thanks again for all of your time and help! :grin:

1 Like

I made this sample project for another member of the community but it should show the concept.
https://x.thunkable.com/projectPage/601251952713580012555b7a

When you select an item from list one, I use the index to open the link in list 2

Hope this helps

2 Likes

Thank you so much Muneer! I see what you did here and it makes a lot of sense when I look at it! :grinning:

I have a few questions, as my app is getting a bit complicated (to me!) & my head is spinning as I try to adapt these concepts to what I have already. I hope you don’t mind a few additional Q’s… :pray:t3:

I set display text to connect to the variable “displayverse”.
I’m not sure if that’s right, but if I set it to “displaytext”, all of the rows immediately end up showing together.

I am also unsure how to connect an individual item and index to my blocks without “list viewer” - is that an essential element here? I wasn’t sure, because I am not using a list to click - these audio files are being randomly selected from col 1 and the corresponding text in col 2 needs to display. No written lists are needed.

Do I add all of this functionality within “set track”? :thinking:

Apologies if this is all a bit obvious, it isn’t to me! :sweat_smile: Thank you again for you time and advice - it’s much appreciated!

1 Like

Please see my explanation in this sample project

https://x.thunkable.com/projectPage/601cf5c2988b8128b77e801e

1 Like

Muneer, I really can’t thank you enough for all of your help!
This worked so well when I adapted it to the app, just perfect!

:100: !!!

Thank you so so much for all of your time and effort to put these samples together so I could understand it. That made all of the difference, and now I have a functioning app!!!

:star_struck:

2 Likes

Glad it worked for you.