# Shuffle the items in a sequence randomly

**URL:** <https://forum.novacura.com/t/shuffle-the-items-in-a-sequence-randomly/1070>\
**Category:** Flow Connect\
**Created:** [November 12, 2025, 10:58am UTC](https://forum.novacura.com/t/shuffle-the-items-in-a-sequence-randomly/1070 "2025-11-12T10:58:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akralk](https://avatars.discourse-cdn.com/v4/letter/a/7C9FD7/32.png) [@akralk](https://forum.novacura.com/u/akralk)\
**Post date:** [November 12, 2025, 10:58am UTC](https://forum.novacura.com/t/shuffle-the-items-in-a-sequence-randomly/1070/1 "2025-11-12T10:58:33Z")

</div>

I need to shuffle a sequence of questions randomly based on their question Ids from 1 to 10. How can I achieve this using the random() function?

---

<div class="post-metadata">

**Author:** ![fabianlidman](https://avatars.discourse-cdn.com/v4/letter/f/7C9FD7/32.png) [@fabianlidman](https://forum.novacura.com/u/fabianlidman)\
**Post date:** [November 12, 2025, 11:03am UTC](https://forum.novacura.com/t/shuffle-the-items-in-a-sequence-randomly/1070/2 "2025-11-12T11:03:13Z")

</div>

That’s a fun question! You do it by ordering by the result of the random function, e.g.

```typescript
open Seq;

let numbers = range(1, 10); // example data set: numbers 1-10

return numbers.orderBy(x => random(0, 1)); // return them in random order

```
