Random Repeating Group

Hey guys,

I’m trying to figure out how to make my repeating group display random items.

I used random: but it only returned 1 item.

Any Ideas?

Do you mean that the randomly selected element is always the same?

I also experienced that the built-in random function was not really reliable, so I use the random number generator plugin and then display item#random number generated.

How that helps.

If I misunderstood your question, can you share the link to your editor to provide more context?

No, I have a list of users called (Other Users) and I want the list of 8 users to always change when the page is refreshed.

Like this list on Linkedin. The list is always random.

When you do your search you can sort users randomly server side and then display the first 8 results. Is that what you’re doing already?

1 Like

The repeating group is only displaying the same users. Which are the list of users first created. I want the repeating group to pick 8 users randomly.

Are your sorting your search results randomly in the search query? Can you show the search parameters?

I would build you a quick demo but I’m not on a computer right now.

Alright. You can use the sort by dropdown and choose “randomly”.

3 Likes

LOL Man, I can’t believe I didn’t look there.

You’re awesome man. THANKS SO MUCH!

1 Like

No problem. I think for your use case this method is fine. But like I mentioned, it’s not 100% reliable in the sense that the randomization might not be truly giving different results at every subsequent page refresh. So if in the future it’s for something more vital in your application flow, you might want to look into the plugin above.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.