Generate Random Numbers in Make.com: A Quick Guide

In this quick guide, I’ll share several methods for generating random numbers tailored to your needs.

Whether you’re looking for a random number between 1 and 10 or a 10-digit random number, in a bit you know how.

All the examples I showed in the video, are also written down below 🙂

Random number between 0 and 1

Don’t have any requirement to the number? The easiest is to use the random variable:

insert random variable into your scenario
The ‘random’ math variable

As you can see, this will generate a random number between 0 and 1 (but not including 1) with 16 decimal places:

random

= 0.5297136290576396

So if that’s all you need, great!

If you need a whole number, or a random number between certain values, keep reading 🤓

Pssst. Want my best tips for Make.com? Get the cheat sheet 😄📩

Psst. Want to get the most out of Make.com? Consider my in-depth course 😄

Psst. Want some 1:1 help with your project? Book a coaching call with me 😄

Random number between 1 and 10

To get a whole number between 1 and 10, we can use the random variable with some math functions.

First, we multiply the variable by 10 so we get a number between 1 and 10 with decimals:

random*10

= 8.364132191975076

Then, we use the floor() function to round it down to the nearest whole number.

floor(random*10)

= 8

This will now give us a number from 0 to 9, so simply add 1 to the formula to get a number from 1 to 10.

floor(random*10)+1

= 6

Easy, right?

Random number between 1 and 6

Want to create a fun dice game? 🎲

You can use the same method as above, but then multiply the random variable by 6.

floor(random*6)+1

= 4

Another method if you just have a few numbers is to use the split() function to make an array with the numbers 1 to 6, then randomly reorder them with the shuffle() function, and then use the get() function to get the first number.

get(shuffle(split(1,2,3,4,5,6;,))1)

= 4

Both methods work, and they randomly give you a number from 1 to 6.

Personally I like the first method with the floor() function, but the second method is especially nice if you want to randomize something that isn’t numbers.

For example you could have the word equivalent for a number:

get(shuffle(split(one,two,three,four,five,six;,))1)

= four

Or you could use it for something completely different:

get(shuffle(split(apple,pear,strawberry;,))1)

= pear

Random number between two numbers

Need a random number between two specific values? Use this method.

Let’s say we want a number between 2 and 5.

First, we look at how many total number possibilities that is:

  • 2
  • 3
  • 4
  • 5

This means there are 4 possible numbers.

So what we do, is we generate a random number between 1 and 4 first:

floor(random*4)+1

= 3

This will always give a number between 1 and 4.

Then to make sure it’s between 2 and 5, we simply add an additional 1 at the end.

floor(random*4)+2

= 3

Now, this will always give a number between 2 and 5.

This method works the same for larger ranges.

For example, if we need a random number between 250 and 750:

We calculate the total possible numbers by subtracting the lower number from the higher number and adding 1: 750-250+1=501

So, there are 501 possible numbers in this range.

floor(random*501)+250

= 382

As you can see, we first made a random number between 1 and 501, and then we added another 250 to make sure it’s between 250 and 750.

So in short, the formula is random multiplied by the amount of total numbers, plus the amount of the lowest number.

Random percentage

Useful for probability-based automation where you need a percentage value.

This formula essentially gives you a random number between 1 and 100.

floor(random*100)+1

= 48

Or if you need the percentage with it, surround the formula in brackets and add the percentage symbol.

(floor(random*100)+1​)%

= 62%

Random number with 10 digits

Need a long random number?

Multiply the random variable by 1000000000000 if you for example want 10 digits, and use the round() function to round it to the nearest whole number.

round(random*10000000000)

= 3029472548

Or multiply by 100000 if you want 5 digits. Simply change the amount of zeros for the amount of digits you want.

round(random*100000)

= 93728

That’s it!

Random round-robin

Want to split data evenly across multiple routes in a scenario?

To make sure each route gets an equal share, a round-robin approach is ideal.

If you want three different routes in your scenario, an easy solution would be this formula:

floor(random*3)+1

= 3

This will randomly give you the number 1, 2 or 3.

And then compare the result in a filter after a router:

compare formula round robin random number in make.com in filter
Router setup for simple round-robin in Make.com

But an issue with this setup could be that the numbers are truly random, which might be a problem for some use cases like dividing tasks between team members.

It could happen that a certain route gets executed more than others because they’re not being executed one by one:

  • 1
  • 2
  • 2
  • 2
  • 3
  • 3
  • 1
  • 2
  • 3

Instead of each route getting executed equally in exactly the right order:

  • 1
  • 2
  • 3
  • 1
  • 2
  • 3
  • 1
  • 2
  • 3

So if it’s important that each route gets executed equally, and exactly in the right order, then you need to use the increment function with the formula below.

(1. i+1)%3

= 0, 1 or 2

This will return 0 on the first scenario execution, then 1, then 2, and then loop back to 0 again.

Or you can add 1 if you prefer 1, 2 or 3.

(​(1. i+1)%3)+1

= 1, 2 or 3

Check out the round-robin tutorial to learn how it works.

Conclusion

I hope this helps you to create random numbers for your automation projects in Make.com 🤓

If you’ve any questions or ideas, let me know in the comments below.

Get the Make Cheat Sheet 🚀

Make can get a bit techy, but with this cheat sheet you’ll quickly understand how to easily setup scenarios. I hope these tips will save you some time! 🙂



Become an automation expert fast 🚀

Save hours a week in your online business with my in-depth Make.com course.

Tell me more about the course! 🔥
Max van Collenburg

I'm addicted to travel, love a good cappuccino, have two cute cats, and I help online business owners to win back their time with no-code automation. More weird facts about me.

14 thoughts on “Generate Random Numbers in Make.com: A Quick Guide”

    • Hey Fátima! The numbers are truly random, but repeat numbers are possible.

      You can’t have truly random numbers that don’t repeat because random numbers don’t have memory. You might want to look at a round-robin solution.

      Good luck!

      Reply
    • Hey Holly! The numbers are truly random, so I won’t take into account any numbers that were already generated.

      A solution could be to store the numbers into a data store, and check if the newly generated number is equal to a number in the data store, and generate a new one if it’s already in there.

      Reply
    • Sure thing! Just be sure to check if the random number being generated hasn’t been already generated before, otherwise it might happen that two people get the same lottery number 😋

      A way to do that would be by adding all generated numbers in a data store, and then after a number was generated, check if it already exists in that database.

      Probably very low chance of that happening, especially with long numbers, but it’s definitely something to keep in mind.

      Good luck! Cool use case! 🙌

      Reply
  1. Hey, just watched your video and read the article, very interesting stuff! I’m not totally sure how I’d use this in my projects yet, but it looks really useful. Maybe a bit more examples could help? Anyway, great job explaining everything, especially for someone like me who’s not that tech-savvy!

    Reply
    • Glad you find it interesting! If I come up with more examples, I’ll add them to the article! Feel free to share some ideas 😄

      Reply
  2. Absolutely brilliant guide, Max! I’ve always found myself a bit tangled up when it comes to generating random numbers for projects, but your explanations are spot on and super easy to follow. Loved the mix of simple and advanced techniques. Keep these gems coming!

    Reply

Leave a Comment