Shuffle Button & Populate with Details on Next Page

hey guys, anyone knows how to get a random objectId from data using a shuffle function and pass it to the next page…

So that when the next page calls for the, the details of the chosen shuffled user pops up?

I’ve tried tips from Select a random item from a data variable containing the array response of an API

(this was returning single digits in the objectId string)

and Getting Random Data

(this was returning all results in my data separated individually.)

In the end I had to resort to bad javascript to achieve something like this, I think


hoping the team has some way to do it in a more straightforward manner :joy: :crossed_fingers:

I have found a way to do this without code. Sharing it in case anyone is interested.

So my aim was to press a button resulting in the next page showing randomized user details.
Breaking down that into logic is to generate a random object Id, and pass it on to the next page as page parameter, which the formulas could use to get other details of this specific objectId.

In my generate random button’s logic flow, formula for that GET RECORD was LOOKUP(PICK_ITEM(data.userUpdates1, RANDOM_INTEGER_BETWEEN(0, COUNT(data.userUpdates1)-1)), ‘objectId’)

Explaining this logic:
First, a random integer between the first row and the last row of objects will be generated.
With PICK_ITEM, that row will be picked within your database. Mine was called userUpdates1
With LOOKUP, the objectId of that specific row will be picked up and placed into the response of GET RECORD.

The logic flow continues with a Open Page component, with the value of it being the response of the GET RECORD.
This then passes the randomized objectId to the next page.

And in the page I’m opening, all fields to be populated with data related to this objectId passed over has similar formula structure to data.userUpdates1.username

You could replace username with whatever column you want to depict data from.

Hope it helps. :slight_smile: