To pick a random row of data from a table, the ANY() function will not suffice. Hereโs a simple pattern to do this:
index(Test Score[Key],
randbetween(1, count(Test Score[Key]))
)
Where โTest Scoreโ is your table name and โKeyโ is that tableโs key.
This sample app shows this in two ways:
We format a row randomly. When you resync the app, a new random row will be selected each time (in bold red)
We have an icon on the left side of the table which will assign a โpersonโ to the โtest scoreโ randomly.
This comes up from time to time in various situations and I didnโt see an existing forum post. As usual, chime in if you have a better version!
NICE! This is like one of those perfectly reduced forms of an expression. Itโs the cleanest, shortest way you could randomly select a record from a list of unknown length.
โฆfor now
Maybe this should be a feature request!
RANDOM({list})
where the list could be a SELECT, FILTER, or any other list. And the value returned has the corresponding data-type of the source column (list of Refs, dates, etc).
Or:
ANY(
ORDERBY(
Test Score[Key],
RANDBETWEEN(1, 999999)
)
)
How do i get the return label column vs displaying the key column?