How can I randomly pick a value out of a dataset?

Hello,

I am having trouble with an automation in Make.com.

I am scraping 161 values with Apify, text based.

I want them to randomly be chosen out of this list, right now they go 1 by 1 in order.

I am trying to use an aggregator and set variable to make them random, but either they get all selected together or they still go in order.

What do I need to change?

The aggregator is outputting values correctly.

But in the set variable option only 1 gets imported.

Can someone advise?

Hello.
Once you get an array from array aggregator, use the following formula to get a random value of the array.
The random value will be extracted and stored into the variable. You can use this variable afterwards.

Welcome to the Make community!

When you have multiple bundles and want just one item, you can use an Array Aggregator first to combine them into an array, then use the shuffle-first functions.

If you already have an array, then just use the shuffle-first functions directly. You can put this in a Set Variable module if you need a module to put these functions in.

{{ first(shuffle(array)) }}

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Getting Started

  • Help Centre | Tutorials – Make “Manual” - search for help here first
  • Make Academy – Basics 101: Learn Make properly to get your money’s worth

Help Centre Basics

Articles & Videos

Hope this helps! Let me know if there are any further questions or issues.

— @samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

2 Likes

Thank you so much! This worked, you’re a star!

1 Like