In this blog, we will understand how to generate 4 digit random number in Power Automate. (MS Flow)
Understand how to use rand() function in Power Automate.
Steps to be followed:
- Add Compose action.

- Go to Expression and search for rand() and select that.

- rand() function requires two-parameter of type integer.
- rand(minValue, maxValue)
- it returns a random integer from a specified range, which is inclusive only at the starting end.
- To get 4 digit random number we will enter below values:
- minValue: 1000
- maxValue: 10000
It will return random numbers between 1000 to 10000.(it will exclude 10000 maxValue)

Output:
