Hello! newbie here… I’ve looked around the forums and clicked through all the tutorials I could find, but I still can’t seem to figure out whether this is possible or not.
I’d like to build a list where an image is attached to a certain piece of text and then use a button to provide the user with randomized answers.
I’ve figured out how to randomize a list of images via the Rollin app. Using that as a jumping off point, I figured out how to make a randomized list of text.
I can’t figure out how to connect an image with a specific piece of text so that they appear together when a single button is pushed. Am I missing something super simple?
The only workaround I can think of is to use an image editor to add text to the images…
Hey, you can make a system in which for example piece of text linked to image A is displayed, so you assign a variable the number 1 and then you set a condition which goes if variable = 1 then show imageA
Same for piece of texte 2 set variable to the number 2 and then if variable = 2 then show imageB
That’s a much more elegant looking solution than mine. I was thinking of matching images with some longer text, so this probably won’t work for that, but I’ll definitely try it when I have shorter titles or descriptions!
Hi, I was looking at you suggestions for the randomizing of a list of objects/JSON, however I wasn´t able to adapt it to my project.
I have this JSON list with questions and their respective answers. This is a short list for an example, the real one will be larger.
What I want to do is to randomly select a question and then with a clic of a button show the answer. As you can see in my screenshot, right now I´m just using labels to show both Q&A for the purpose of this exercise. However, I noticed that in the pink blocks you cannot use math (blue) or variables (orange) to get properties (e.g. get property: “Random integrate from 0 to 2” block). Is there a way to randomly select/obtain object fields? In your previous examples you either manually type the JSON or manually create the objects, however I cannot do that because my list comes from a database.
Another thing that I tried, as you can see in my gray inactive blocks at the right of the image, is to create a list from the database, which I am able to select random items. However, by using “}” as a delimitor to create the list I obtain something like this in my label text:
{“Question”: “Question B”,“Answer”: “Answer B”
And by using a comma “,” as delimitor I obtain:
{“Question”: “Question B”
“Answer”: “Answer B”}
The problem is that I just want to show the Q or the A without all the coding symbols. Another scenario could be obtaining again the property Answer or Question with pink blocks, but since I disrupted the JSON coding line by previously using the delimitor, this is not an option.
So in summary, I want to either
randomly obtain properties from objects, or
to be able to get a list from the JSON but just with the answer or question, not with the property names and symbols.
As far as I can tell from your JSON it looks like the value obtained by your 'Realtime_DB1call Get key "gine" ...' block be a list of objects. The most straightforward way to obtain a random item from a list is to use the 'random item of list ...' block. So something like the following should work for you:
Yes @Mark,
are you in the possiblity to make something like that…
Clock-reading or also for ‘mathematics’ randomly show questions or images and connect to it’s correct answer…
for example also the steps to show to children how they need to make a question simple
Hello Thunkable folks. I’m a newbie and building a simple app which has similar requirements to above. On a button click I want random pictures to appear with supporting text attached to that particular picture. For example if the walking picture appears, there is text about walking, if the coasteering picture appears, the coasteering text appears. I thought I’d blocked it correctly but the text is appearing with random pictures. They just don’t match up! I’d love to be able to assign a website link for each picture/text too. This is where I’ve got to. Thanking you
You have lots of blocks. Simply use the local db. pictures in one column and texts in another. then look up how to call data from airtable or local db. you’ll then end up with much fewwer blocks.