Hi,
Im trying to generate a random number using the JS code:
$parameters.IncdiceDrawn = Math.floor((Math.radom() * $parameters.Quantity));
But when I open the page on the web screen And click the button to the action, the follow message appear: (error) Math.random is not a function
Somebody now any solution.
Thank you.
The problem here is radom, which should be random().
$parameters.IncdiceDrawn = Math.floor((Math.random() * $parameters.Quantity));
Thank you so much Márcio.
Hi Bárbara,
You can refer this component for randomize number generation
https://www.outsystems.com/forge/component-overview/677/randomizer-number-generator
Hi @Bárbara Fernandes
I think you have a typo in "Math.radom()", do you meant "Math.random()"? :)
Regards,
Rúben
Thank you so much Ruben!
Hey,
I believe you will find this forge component very useful (most of these things are already covered there):
Reactive Utilities - Documentation | OutSystems