I am trying to create a random card generator. In this case, the card is just a piece of text, which I call prompts. So I have a type called “black card” and a super long list (2500) of prompts.
I created a rectangle with dynamic text that says Search for Black Cards:random item’s Prompt. Under that I put a button that refreshes the page.
This is my solution but it sucks. The reason being that the prompts take so long to show up. I’m talking like 10 seconds. I’m assuming because it is searching for all 2500 prompts and then picking a random one. Is there a solution to this?
I also would like the button to show the next random prompt rather than refresh the whole page. How can I do that?
No, you can just use this plugin to generate a random number:
So in your workflow, user clicks the button and you generate a random number from 1 to “do a search for cards: count”. Then the final part will be to display card in the text group e.g display data in group (do a search for cards: item number “random generator number result”)
The second part I’m not sure how to do. I created a text group but I’m not sure what to put as the source. I don’t know how to pull the number generated from the button.
I think I’m making progress. I bound that you have to go to the button workflow to display data in a certain group. I still don’t know how to pull the random number generated by the button. Here’s a picture of where I am. What do I there?
To get the number you just select that drop down in the screen shot “result of step 1 random number…”
That will then send the data to the group. Then you just put the text element inside the group and select the text to be “parent groups black cards title” (I’m assuming title here, depends on your column name for text thing)
I tried doing this and while it works perfectly - i tried tracking the “rolled number”. The Random generator was showing the correct number but after displaying data, the number changed like for example: Random Generator showed 42 but it returned a 28.
Also, i set the Maximum in the Random Generator to what you said as in Erick’s issue which is “search for…: count” and it was going beyond the the number of data i have (which is only 50). I decided to set the Max manually to 50 and this worked. But the number being returned after displaying data was not accurate at all.