Sort elements in random order
Options
Robert_LoopLabs
Member ✭
Hey everyone, is there a way in xano to sort elements in a random order, but to make that order consistent with pagination? Something like using a ORDER BY RAND(SEED) in sql. Similar to this stackoverflow quesiton: https://stackoverflow.com/questions/10729633/php-mysql-pagination-with-random-ordering
Thanks a lot!!
Answers
-
Hi @Robert_LoopLabs — not currently with a Query All Records. However, this may be possible using an SQL statement with our Direct Database Query function!
-
Hey @Robert_LoopLabs & anyone else looking on! Got this working with @Chris Coleman's Direct Database Query suggestion.
You need two statements:
- SELECT setseed(0.351);
- SELECT * FROM your_table ORDER BY RANDOM();
XANO's DDQ tool is single-statement. So create two statements in that order and you're good.
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