Google Sheets - Search and then randomise

Hi all :slight_smile:
I am doing a search rows through google sheets to get the values of rows that have a specific value but I want the only pick a random number of 3-5 of those entries and then randomise the order of them.

I have created a variable called random_count which is a round number of a random number between 3 and 5 and thinking of using the repeater but then completely stuck as to how I would randomly select the 3 to 5 rows that from that google row search?

Thanks in advance :slight_smile:

You have to use an Array Aggregator first to combine the results before you can randomly pick items from them.

Aggregators

Every result (item/record) from iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module.

If you need further assistance, please provide the following:

  • Output bundle of the Array Aggregator module.

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

— @samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

Thanks, I have the aggregator and it is putting it into an array, but I am saving the variables in the loop so that’s fine, I just don’t know how to randomise them and only select some? Thanks

You can use the shuffle() function to randomize your array