Step 1:
Login to the required Power Apps environment using URL make.powerapps.com by providing user name and password and click on Flows on the left hand side as shown in the below figure.
Step 2:
After Step 1, Click on New Flow and select instant cloud flow and provide the trigger as Manually trigger a flow and click on Create as shown in the below figure.
Step 3:
After Step 2, click on + New Step and under Choose an operation and in text box type compose and select Compose Data Operation as shown in the below figure.
Step 4:
After Step 3, rename compose title with rand Function and click on Inputs and select 2nd tab Expression and type rand and observe it expect 2 parameters first 1 minValue with integer type , 2nd is maxValue of integer type we can pass as shown in the below figure.
Step 5:
After Step 4, rand have the following syntax
rand(minValue: integer,maxValue : integer)
so provide the value as example
rand(1,9999)
and click on OK shown in the below figure.
Step 6:
After Step 5, Save and Test flow after clicking on Run Flow and Done and click on OK shown in the below figure.
Note:
Conclusion: In this way one can easily generate a random number in few minutes and use it for required scenario.