How to fetch a random record?
I'm trying to pull back just one of the 7 records from my 'messages' collection in the Tiggzi cloud DB.
I've tried putting /random on the end of the service :
https://api.tiggzi.com/rest/1/db/coll...
(not sure if that is correct but doesn't work anyway)
and I've tried running a custom javascript onPageShow:
Code: Select all
function getRandomInt (min, max) {
var myVar = [1,2,3,4,5,6,7].randomItem();
} but in datamapping my variable doesn't show up so I can map it to the text input.
Can anyone put me on the right track please?
thanks in advance
Mike