I have a timer and random picker (both components from the marketplace). I want the random picker to activate (show another random record from my database) whenever the timer runs out. Right now it looks like the only way to “activate” the random picker and change what’s its showing is to have a user click on it; I however want this to happen automatically, without the user doing anything.
Hi @bruh ,
You could have the random picker hidden with a visilbility condition from an input text field, say when input text field is equal to 0 hide random picker, when timer runs out, it changes the value to 1 for example, then the random picker will show
Hello JL, thanks for the reply, but this isn’t what I’m looking for. My problem has nothing to do with visibility.
I saw it now :slight_smile, my bad:, misread it. I will check into it then. But at a high glance, not sure if possible.
You can do this with the countdown! But need a ID for each record in that collection!
Check this topic created by @DaBoo! : Random Text How-To
You need to add the action that added to the button for the countdown!
Thank you for recommending this! I had a feeling I’d have to resort to brute-forcing this. I have to say that doing it this way is very very costly in terms of performance, which is why I wanted to avoid that. But this technically works, so thank you!
This process, from what I see at a glance, every time is updating user with a random number to then filter the question, because there is no way of triggering the random number without it.
But this method has a flaw. It works in this case because there are only 5 questions and they are not added or deleted.
In the case where you use a collection where records are being created and deleted it fails.
Imagine you have a collection with 50 records. so the count is 50, so you can have a random record between 1 and 50 (record count), all good so far.
But now if I delete records from 30 to 35 and 45 to 50, my new count will be 40.
So no record with ID from 45 to 50 (New count is 40) will ever be selected, and if there is random number selected from 30 to 35, it will never appear, because those IDs where deleted, so result will be empty.
Adalo IDs are unique, so if you delete, they are not replaced as it should for primary keys in databases.
if it is a question number, from 1 to 50, same principle applies, you deleted still 30 to 35 and 45 to 50, these questions are not also there anymore, Unless the whole records are indexed again.
So method only works for collections where there is no deletion of the records so count will always be valid.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.