Random Number Generation In UIPath

Fixed Length Random number generation in UiPath
Lets  say I want to generate a 5 digit random number as per my requirement.
when I use  new System.Random().Next(0,99999)  in assign activity uipath , it can generate a random number  every time I execute , lets say random numbers  are  32123,45612,78901.
But it can also generate 234,561,0078 and 00032 which 32  which is not correct as per our requirement.
So how  to generate a random number of fixed width in our case its 5 digit random number .
We know that minimum 5 digit number is   10000 and also maximum 5 digit number can be 99999.
So lets use this logic in our case  new System.Random.Next(10000,99999)  so if I execute this it can generate 12456,78431,61534 ..etc  .

You can follow the below video

3 to 7  --- 100-9999999

About author


Tech enthu, owner of kbtutorials youtube channel

Leave a Reply