Random flows

Hi sorry to not fully understand what is happening here but maybe you can give me a litle explaner.

The card for the random funktion looks like this {{round(random(0.5,4.4999))}} but now I have added 9 random flows that it should be choosing from, but it seems that it is not chosing between all of them. I thinking that it has somthing with the random logik code, but I´am not sure what should be done when and what the numbers meen.

hope you can help me. :slight_smile:

That is because the random function (after rounding) will result in a number between 1 and 4. If you want it to go from 1 to 9 it should be {{round(random(0.5,9.4999))}}

The numbers within the round function are the upper and lower bound. The lower bound is saying 0.5, which rounds up to 1, and the upper bound is saying 9.4999 which rounds down to 9. The decimals are there to make sure each number has an equal chance of occuring.

To give you an example why all the decimals are there: the round function would turn all numbers from 4.5 upto 4.4999 into a 4. So if we would say the lower bound for random is 1, then only 1.0 til 1.4999 would result in 1 and that is a smaller range. By saying the range starts at 0.5, then all numbers from 0.5 til 1.4999 will become a 1, which is the same range size as the example I gave for 4. Same goes for the lower bound: you don’t just want 8.5 til 9.0 to become 9, but all of 8,5 til 9.4999

Great thanks, so that means that the 5 is the delay in secinds and the 9 is how many flows it should use and the last number is the random calc. is that correct. :slight_smile: and thanks again

Yes, the 5 up there was for the delay in seconds, which has nothing to do with the number of choices.

1 Like