# Blog

Blog » 2021 » August » 11 » Random number in Flow
 21:10 Random number in Flow Problem: a random user should be selected from a queue to assign a lead. The number of users in the queue is unknown and calculated on the go (variable `UserCount).` Implications: multiple records may enter the flow at the same time, so the random number should be generated for those (and the timestamp can't be used to generate the random number). Solution: Use date with the combination with data that came with a record to generate a random number. The seed (the starting number to generate a random(~er) number) is a concatenation of date and length of the Lead Name (variable `getLead.Name)` Implication: we don't know the span of a random number (max and min), so, we can't normalize the output. Solution: use last digit of the random number -> this normalizes the span [0-9] Final solution: `````` ROUND(value(Right(text(ROUND(sqrt( (value( (left(right(text(now()),6),2))& text(DAY(DATEVALUE(now())))& text(Month(DATEVALUE(now())))& text(Year(DATEVALUE(now())))& (left(right(text(now()),9),2))) )/100 )+ LEN( {!getLead.Name}),0)),1))/10*{!UserCount},0) ``````