pull a random record?
Options
![Mitch](https://us.v-cdn.net/6037124/user_avatars/2157194.jpg)
Mitch
Member ✭
Hi there,
Is there a simple way to pull a random record from a table? I know I can do it in a few steps... counting the total records, choosing a random number equal or less than that total, and searching by ID..... but in this case, I'm pulling quite a few variables, so I'm trying to be as lean as possible.....
Thanks!
Is there a simple way to pull a random record from a table? I know I can do it in a few steps... counting the total records, choosing a random number equal or less than that total, and searching by ID..... but in this case, I'm pulling quite a few variables, so I'm trying to be as lean as possible.....
Thanks!
Comments
-
You can do this in one line: Use the Query All Records function. Change the return type to single and add a random sort.
-
duh......
thank you, Michael 😄 -
I don't understand how to add a random sort to the record.
-
(Query All Records > Output > Return > Add Sort > Select a field and "random")
[CleanShot 2022-08-08 at 10.30.08.png][CleanShot 2022-08-08 at 10.30.30.png] -
Thanks a lot.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback